MongoDB welcomes community contributions! If you’re interested in making a contribution to MongoDB for VS Code, please follow the steps below before you start writing any code:
- Sign the contributor's agreement. This will allow us to review and accept contributions.
- Fork the repository on GitHub
- Create a branch with a name that briefly describes your feature
- Implement your feature or bug fix
- Add new cases to
./src/test
that verify your bug fix or make sure no one unintentionally breaks your feature in the future and run them withnpm test
- Add comments around your new code that explain what's happening
- Commit and push your changes to your branch then submit a pull request
You can report new bugs by creating a new issue. Please include as much information as possible about your environment.
We recommend familiarizing yourself with the VSCode extension documentation: code.visualstudio.com/api.
Running the MongoDB VSCode plugin requires Node.js and npm.
- Clone this project, navigate to the folder, then run:
npm install
npm run watch
- Inside of VS Code Insiders open this directory and press
F5
to begin debugging the extension. This should launch a new VSCode window which is running the extension.
out
Compiled extension codeimages
Icons, logos, etc.snippets
Bundled Terraform Snippetssyntaxes
Syntax highlighting for MongoDB keywordssrc/test/suite
Where tests live with '*.test.ts
' files namesscripts
Project helper scripts
The MongoDB VSCode extension is not released on a set schedule. A new version is released on demand or when there are some features ready to go live.
Releases are automated using github actions, and published to the VSCode marketplace using a Personal Access Token (PAT). For additional information and reading, VSCode has some great documentation on publishing extensions: https://code.visualstudio.com/api/working-with-extensions/publishing-extension https://code.visualstudio.com/api/working-with-extensions/continuous-integration
- To kick off a release run the Draft Release Github Action, specifying the type of bump from the dropdown (patch, minor, major) or the exact new version. When a bump is selected, the version of the release being drafted is derived applying the selected bump the last released version.
- The action runs tests, creates the
.vsix
artifact for the new release version and creates a draft GitHub release (tagging the HEAD ofmain
), with the.vsix
artifact attached. At this point you can look in https://github.com/mongodb-js/vscode/releases and see the draft release. - Now let's download the built
.vsix
artifact in the new GitHub release draft and ensure it works smoothly. https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix Manually test the new version using the testing matrix found here: https://docs.google.com/spreadsheets/d/1014WyX-WPMfZTj6qVyYDA1JowGCFNCOQGgEhIA0O0bs/edit#gid=0 Duplicate the testing template page and rename it the new release. Not every test needs to be performed before we release, however, the critical paths should be tested. - Update the release notes in GitHub, documenting user facing changes. Once you’re happy with the changes you can publish the release.
- When the release is published, the GitHub action https://github.com/mongodb-js/vscode/blob/main/.github/workflows/publish-release.yaml is automatically run, which downloads the release artifact and then publishes it to the VSCode marketplace.
- Nice! ✨ Now you can verify it all completed by visiting https://marketplace.visualstudio.com/items?itemName=mongodb.mongodb-vscode and seeing the new version is up. You also try installing it in VSCode :) ✨
- Lastly, don't forget to post in slack, let all your friends know, and close the release ticket in jira if there is one.