-
Notifications
You must be signed in to change notification settings - Fork 39
feat: Add GitHub Codespaces support to Learning project #170
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: main
Are you sure you want to change the base?
Conversation
- Add .devcontainer configuration - Create .env.example template - Update .gitignore and README Resolves google-gemini#154
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @mscarpenter, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the developer experience for the Learning project by integrating GitHub Codespaces. This allows users to launch a fully configured development environment directly in their browser, eliminating the need for complex local setup and streamlining the onboarding process for new contributors or learners. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This PR adds GitHub Codespaces support, which is a great enhancement for developer onboarding. The changes are well-structured, including the devcontainer configuration, an example environment file, and updated documentation. My review includes a few suggestions to further streamline the Codespaces experience by automating more of the setup process and providing recommended tooling. I've also suggested updates to the README to make launching a Codespace even easier and to align the documentation with the proposed automated setup.
| { | ||
| "name": "Gemini Learning - Pedagogical Concept Graph", | ||
| "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/git:1": {}, | ||
| "ghcr.io/devcontainers/features/github-cli:1": {} | ||
| }, | ||
| "forwardPorts": [ | ||
| 3000 | ||
| ], | ||
| "portsAttributes": { | ||
| "3000": { | ||
| "label": "Learning App", | ||
| "onAutoForward": "notify" | ||
| } | ||
| }, | ||
| "postCreateCommand": "npm install", | ||
| "postStartCommand": "echo '🚀 Ready! Run: npm run dev' && echo '📝 Set GOOGLE_API_KEY in .env.local (copy from .env.example)'", | ||
| "remoteUser": "node" | ||
| } No newline at end of file |
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.
This is a great start for the devcontainer configuration! To make it even more seamless for developers, you could make a couple of improvements:
- Automate
.env.localcreation: ThepostStartCommandcan be updated to automatically copy.env.exampleto.env.localif it doesn't exist. This saves the user a manual step. - Add recommended VS Code extensions: Including extensions like ESLint, Prettier, and Tailwind CSS in a
customizationsblock ensures everyone has a consistent and optimized development environment.
Here is a suggested version incorporating these changes.
{
"name": "Gemini Learning - Pedagogical Concept Graph",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss"
]
}
},
"forwardPorts": [
3000
],
"portsAttributes": {
"3000": {
"label": "Learning App",
"onAutoForward": "notify"
}
},
"postCreateCommand": "npm install",
"postStartCommand": "if [ ! -f .env.local ]; then cp .env.example .env.local && echo '✅ Created .env.local from .env.example.'; fi && echo '🚀 Ready! Run: npm run dev' && echo '📝 Set GOOGLE_API_KEY in .env.local'",
"remoteUser": "node"
}| ### Prerequisites | ||
| ### 🚀 Quick Start with GitHub Codespaces | ||
|
|
||
| The fastest way to get started is using GitHub Codespaces - no local setup required! |
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.
To make it even easier for users to start a Codespace, you can add an "Open in GitHub Codespaces" badge. This provides a one-click way to launch the environment directly from the README.
| The fastest way to get started is using GitHub Codespaces - no local setup required! | |
| The fastest way to get started is using GitHub Codespaces - no local setup required! | |
| [](https://codespaces.new/google-gemini/workshops) |
learning/README.md
Outdated
| cp .env.example .env.local | ||
| # Edit .env.local and add your GOOGLE_API_KEY from https://aistudio.google.com/app/apikey |
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.
If you adopt the suggestion to automate the creation of .env.local in devcontainer.json, these instructions should be updated to reflect that the user no longer needs to manually copy the file. This will make the setup process even smoother and less error-prone.
| cp .env.example .env.local | |
| # Edit .env.local and add your GOOGLE_API_KEY from https://aistudio.google.com/app/apikey | |
| # A .env.local file is automatically created for you when the Codespace starts. | |
| # Edit .env.local and add your GOOGLE_API_KEY from https://aistudio.google.com/app/apikey |
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.
Hey, @mscarpenter! Can you sign the CLA (see above); so we can merge?
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.
Hi @klutometis! I've signed the CLA and the checks are passing now. Ready for merge!
Summary
This PR adds GitHub Codespaces support to the Learning project, making it easier for users to get started without local setup.
Changes
.devcontainer/devcontainer.jsonwith Node.js 20 environment.env.exampletemplate for API key configuration.gitignoreto allow.env.examplewhile blocking secretsTesting
Resolves #154