-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: creates a devcontainer configuration for contributors #10937
base: master
Are you sure you want to change the base?
Conversation
|
{ | ||
"name": "Node.js", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason for picking this image? I suppose it doesn't make much difference for an application like this one with basically zero "system" dependencies beyond node, but my instinct would be to base this off be node:20-alpine
since that is what we use in https://github.com/badges/shields/blob/master/Dockerfile
In any case, yes. We definitely want node 20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vscode can generate a devcontainer which then uses Microsoft's set of "officially maintained" ones. That's where this image comes from. I can use a basic node:20-alpine
as well, the devcontainer config will just need to also prep git and some other things. Given it's "the node image designed for devcontainers" managed by Microsoft, would you be fine leaving it in? Happy to change it to node:20-alpine
and the subsequent other changes to the devcontainer if you'd prefer.
So there's a couple of things here:
|
Makes total sense! I included those extensions because of what the I am installing The Otherwise we have a minimal config: use the Node 22 image and run Totally happy to remove the |
Yeah, totally. I am not sure what's up but I can't get The easiest way to reproduce would probably be to pull the edit: am just now seeing the screenshot says "not compatible with your version of node/npm" I read that as "npm". So it's more likely to do with incompatibility with Node 22.x? Which could be expected by you - I assumed 20 or 22 would work since there was a mention that tests must pass against both but there isn't an equivalent |
Right, yes. We're currently running on Node 20 in production so that's what we ask users to run locally https://github.com/badges/shields/blob/master/doc/TUTORIAL.md#node-npm . I should have updated the engines declaration when we got everything passing on node 22. I've done this in #10940 That allows you to install on node 22 without specifying |
I think lets not specify any extensions here.
Postgres is required for the integration tests ( https://github.com/badges/shields/blob/master/CONTRIBUTING.md#tests I think if you want to provide a working postgres as part of a devcontainer setup there's probably a bit more to do here than just install a package. If you want to do that, can you run through the process of what you need to do to get to yourself a stage where you've got the integration tests passing in that environment. If we're going to take on the maintenance and support of this (which is what you're asking us to do here) we need to do one of the following:
Tbh, I'm inclined to just keep it really really simple if we're going to take this on. I don't use devcontainers myself, so what I really don't want is to merge this and then someone opens an issue saying "I'm trying to contribute to shields and I'm stuck because [something something devcontainers]". It is just a category of support I have no appetite for. |
{ | ||
"name": "Node.js", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason for picking this image? I suppose it doesn't make much difference for an application like this one with basically zero "system" dependencies beyond node, but my instinct would be to base this off be node:20-alpine
since that is what we use in https://github.com/badges/shields/blob/master/Dockerfile
In any case, yes. We definitely want node 20
Absolutely, makes sense. Let me strip it to the absolute minimum that lets someone get a working environment to contribute badges.
Ahh, I didn't take |
I had issues with my local version of NPM being incompatible with the
package.json
requirements (even though it's within the stated^10
...), and figured it would be useful to create a standard development environment configuration via a devcontainer config. It can be used by a number of 3rd party tools these days, but it primarily makes GitHub Codespaces a convenient place to get a working dev environment for this repo.