-
Notifications
You must be signed in to change notification settings - Fork 794
feat: dev container #1367
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
base: v2
Are you sure you want to change the base?
feat: dev container #1367
Conversation
✅ Deploy Preview for tauri-v2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thank you so much for putting this in! I haven't tested the full setup yet but put a few comments for feedback and to get your thoughts.
Pulling this from the Discord conversation:
The flow I have in mind is that a person starts from our repo, they don't have a fork. GitPod, Codespaces, etc. are for those people who don't care about forking, cloning, setting up on their local machine, etc. It's for people who want to contribute a typo fix, a translation, etc. and not worry about all of that. At least in VSCode locally, if I try to "push" to a repo that I don't have write access to it will suggest to me to fork it and open a PR which has been a flow that's worked for me (might need to confirm what that experience is through Gitpod/codespaces to confirm).
I think my reply above addresses this a bit, but going to a put a few thoughts in general on this topic. In theory I love the idea of making it more collaborative and accessible for people to work together, but this could potentially have a lot of security things we have to think through (already had a bit of a scare with some PRs taking advantage of some actions a few months back). Plus, contributors have the check box to "allow maintainers to edit this pull request" which I think will cover any "collaboration" I'd expect tbh. If we hit cases in the future where non-maintainers want to collaborate with each other then we can cross that bridge when we get there. |
Going to do a bit of testing on this one later on. I'm still eye-ing that docker file a bit tbh and if it needs to have that many "convenience" things. But that one might be better to talk through a bit on Discord later. One concern I have with this is commit signing. This doesn't necessarily change the difficulties we have with commit signing today. I'll maybe start a separate discussion on this to get some insight and feedback from the security team. |
The arguments at the top can be removed if you want to make it shorter but they're really not something you need to maintain, they just effectively expose those variables so that you can set them in All in all I'd say that yes, we can take the image down to like 2-3 lines long, but the extras I've added don't actually involve any added maintenance, it's mainly just best practises for docker images and convenience stuff. |
Like, I don't see any solution for using Gitpod that doesn't involve putting keys in a place I'm not comfortable with, other than making unsigned commits first to your own fork of the project, then retroactively signing them, but that's not all that beginned friendly, which I feel is what Gitpod was mainly intended to solve. |
7c76d54
to
bb60b8c
Compare
bb60b8c
to
a665410
Compare
The points make sense. I'll trust your guidance on this one as long as we keep maintainability front of mind. On commit signing, I pinged security in Discord for their input but will also do it here. @tauri-apps/wg-security Can you all give some input on yes/no to NOT require commit signing in the docs repo? I know that ideally we'd want it, but I'm really thinking of if there are any actual risks here that outweigh a (very high imo) barrier to entry for new people contributing. |
We enforce commit signing for several reasons from my perspective but we don't have a central document describing the reasons (or at least I don't know of it). In general signing is just attribution of changes to someone. For us this means whoever commits to our projects is actually identified properly through git commit signatures and not just through Github itself. Signing does not protect us against missing reviews of the PR and merging malicious code. So the thing we are using commit signing for is for simple attribution of whoever wrote the code. Having enforced reviews, ideally by 2 (core-)people, I think this is much more worth than enforcing commit signing for documentation changes from external contributors. However, signing should be the default and encouraged wherever possible. Unsigned code will then stick out and reviewers will have a more critical perspective when checking out the code. |
"settings": { | ||
"extensions.installRecommended": true | ||
}, | ||
"extensions": [ |
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.
Not a big fan of pushing all those third party extensions in the container by default. Are they needed for usage or do they provide convenience from your personal perspective?
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.
The Astro one at least is basically needed for usage. Several of the others are less about being "needed" and more about providing developers with a similar setup of tools related to things like linting and task management. Technically all extensions are always optional, Notepad is the best IDE after all x)
Also it's reeeally annoying to have to manually install all recommended extensions when you load up the repo, this is the only way to make it as quick and easy to just boot up and start editing with. Remember that if it's ultimate customization you want a devcontainer may not be the best to use in the first place, and the main purpose of this devcontainer is to get people up and running quickly.
That's my take on it at least, but I'm not impossible to convince otherwise. I'm not super emotionally attached to the devcontainer.
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.
I'd rather trim it down to only the Astro extension. The idea of having a dev container in the first place is to get something spun up super quick and easy and we should keep the plugins to a minimum to achieve that.
If we slim it down to only Astro's plugin then I think extensions.installRecommended
is fine.
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.
Let's get this one stripped down to the most basic version possible. I want to rely on images as much as possible in here and not have the possibility of something getting out of date and broken for something as non-critical as this.
"recommendations": [ | ||
"dbaeumer.vscode-eslint", // ESLint | ||
"waderyan.gitblame", // Shows blame in source code | ||
"GitHub.vscode-pull-request-github", // Pull requests | ||
"codezombiech.gitignore", // .gitignore | ||
"numso.prettier-standard-vscode", // Prettier | ||
"Gruntfuggly.todo-tree", // To do | ||
"MarkosTh09.color-picker", // Color picker | ||
"redhat.vscode-yaml", // Yaml | ||
"astro-build.astro-vscode" // Astro | ||
], |
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.
Some comment on this, let's only do the Astro plugin
.devcontainer/Dockerfile
Outdated
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.
I want to clean this up to be as minimal as possible. Looking at the container image itself at https://github.com/devcontainers/images/tree/main/src/javascript-node, the only thing I think we need that isn't available here is PNPM. Can we run RUN npm install -g pnpm
so that we don't need to deal with apt
at all?
I think the only thing we need in here is:
FROM
to specify the image and variant- The
RUN
command above to get PNPM
I don't think anything else is needed to get a basic setup going for a user (including the EXPOSE
)
Resolves #1362
I added some extra extensions that are installed automatically when you open the dev container.
Simply start it and run
pnpm i && pnpm dev