Contributing
April 1, 2026 · View on GitHub
Thank you for your interest in contributing to nullvariant-vscode-extensions!
Branch Protection
The main branch is protected with the following rules:
- Pull Request required: All changes must go through a PR (direct push is disabled)
- CI status checks: The
buildcheck must pass before merging - Signed commits required on main: Commits merged to
mainmust be GPG signed (handled by maintainers during merge) - Linear history: Rebase/squash merging is required (no merge commits)
Note for contributors: You don't need to GPG-sign your commits. The maintainer will handle signing when merging your PR.
Developer Certificate of Origin (DCO)
This project requires all contributors to sign off their commits, certifying that they have the right to submit the code under the project's license. This is enforced via the Developer Certificate of Origin.
How to sign off
Add --signoff (or -s) to your git commit command:
git commit --signoff -m "feat: add new feature"
This adds a Signed-off-by line to your commit message:
feat: add new feature
Signed-off-by: Your Name <your.email@example.com>
What you are certifying
By signing off, you certify the Developer Certificate of Origin v1.1 (full text at the link). Key points:
- The contribution is your original work, or you have the right to pass it on
- You have the right to submit it under the project's open source license
- You understand the contribution is public and a record of it is maintained indefinitely
Note: If you forget
--signoff, the DCO check on your PR will fail. You can fix existing commits withgit commit --amend --signofforgit rebase --signoff HEAD~N.
Getting Started
- Fork the repository
- Clone your fork
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Commit with
--signoff:git commit --signoff -m "feat: description" - Push to your fork
- Open a Pull Request
- Wait for CI checks to pass (including DCO), then a maintainer will merge
Development Setup
# Clone
git clone https://github.com/your-username/nullvariant-vscode-extensions.git
cd nullvariant-vscode-extensions
# Set up git hooks (recommended)
git config core.hooksPath .githooks
# Install dependencies
npm install
# Work on an extension
cd extensions/git-id-switcher
npm install
npm run watch
Code Style
- Use TypeScript
- Follow existing code patterns
- Add comments for complex logic
- Keep functions focused and small
Testing
Manual Testing
- Open the extension folder in VS Code
- Press
F5to launch Extension Development Host - Test your changes manually
Unit Tests
cd extensions/git-id-switcher
npm run test
E2E Tests
E2E (End-to-End) tests run in an actual VS Code environment using @vscode/test-electron and verify the extension works correctly as a whole.
Requirements
- Node.js 20+
- On first run, VS Code will be downloaded automatically (~100MB)
Running E2E Tests
cd extensions/git-id-switcher
npm run test:e2e
Adding E2E Tests
E2E test files are located in src/test/e2e/. When adding new E2E tests:
- Create a test file in
src/test/e2e/(e.g.,myFeature.test.ts) - Use the VS Code Test API (
@vscode/test-electron) - Test real extension behavior without mocks
- Clean up any test data after tests complete
UI Module Testing Patterns
When testing UI modules (StatusBar, QuickPick, Documentation), follow these patterns:
StatusBar Tests:
- Test state transitions:
setIdentity(),setNoIdentity(),setLoading(),setError() - Verify status bar item visibility and text updates
- Use
statusBar.dispose()in afterEach for cleanup
QuickPick Tests:
- Modify configuration → call item generation function → verify items
- Use
vscode.workspace.getConfiguration().update()for temporary config changes - Restore original configuration in afterEach
Documentation (Webview) Tests:
-
Limitation: Cannot directly access Webview DOM from tests
-
Use command execution + extension stability verification pattern:
await vscode.commands.executeCommand("git-id-switcher.showDocumentation"); assert.strictEqual( extension.isActive, true, "Extension should remain active", ); -
Test panel lifecycle: create → close → re-create
-
Add stress tests (rapid open/close) to detect resource leaks
-
Set appropriate timeout (e.g.,
this.timeout(15000)) for network operations
CI/CD Integration
E2E tests run automatically in GitHub Actions CI:
- Executed in parallel with the build job
- Uses
xvfb-runfor headless execution on Linux - Currently set as non-blocking (
continue-on-error: true)
Pull Request Guidelines
- Describe what your PR does
- Reference any related issues
- Keep changes focused
- Update documentation if needed
Questions?
Feel free to open an issue for discussion.
License
By contributing, you agree that your contributions will be licensed under the MIT License.
See Also
- GOVERNANCE.md — Project governance model
- CODE_OF_CONDUCT.md — Garden etiquette
- SECURITY.md — Security policy and vulnerability reporting
- AGENTS.md — Constraints for AI-assisted contributions
- Translation Contributing Guide — How to contribute translations for Git ID Switcher