Thank you for your interest in contributing to GitHub PR Tracker! We welcome contributions, bug fixes, feature suggestions, and documentation improvements.
This project strictly follows the Conventional Commits specification (v1.0.0). All commit messages—whether authored by human contributors or automated agents—must adhere to this format.
<type>(<optional scope>): <description>
[optional body]
[optional footer(s)]
| Type | Description |
|---|---|
feat |
A new feature or user-facing functionality |
fix |
A bug fix |
docs |
Documentation-only changes (README, CONTRIBUTIONS, code comments) |
style |
Code formatting, missing semicolons, whitespace (no functional changes) |
refactor |
Code restructuring that neither fixes a bug nor adds a feature |
perf |
Performance improvements |
test |
Adding or updating tests (tests/, classifier tests, mock fixtures) |
build |
Build system, Makefile, schema compilation, packaging changes |
ci |
Continuous integration and deployment configuration |
chore |
Routine tasks, dependency updates, repo maintenance |
- Imperative Mood: Use the imperative mood in the subject line (e.g.,
add toggle option, notadded toggle optionoradds toggle option). - Case: Start the description with a lowercase letter.
- No Trailing Period: Do not end the subject line with a period or punctuation.
- Length: Keep the subject line concise (under 72 characters).
- Scopes: Use optional scopes to indicate the modified component when applicable, such as:
(prefs): Extension preferences and settings dialog (prefs.js, schemas)(classifier): PR categorization and status logic (src/models/prItem.js)(graphql): GitHub GraphQL client and queries (src/api/githubClient.js)(menu): Popup menu and UI cards (src/ui/menuView.js)(indicator): Top panel indicator and badges (src/ui/indicator.js)(auth): Keyring and authentication handling (src/api/keyring.js)
- Breaking Changes: Mark breaking changes by appending a
!before the colon (e.g.feat(api)!: migrate to GraphQL v5 API) or includingBREAKING CHANGE:in the footer.
feat: add toggle option for including team review requests (default: off)fix(graphql): handle null values when fetching branch protection status checksrefactor(classifier): streamline status reason pill computationtest(classifier): add unit tests for team review classificationdocs: add CONTRIBUTIONS.md and AGENTS.md guidelines
- GNOME Shell (45–50+)
gjs(1.80+)libsecret-1(GNOME Keyring)libsoup-3.0make
Before submitting changes, make sure all test suites pass:
make testThe preferences test opens a GTK window, so it needs a graphical session; on a headless machine run xvfb-run -a make test.
The code is checked with ESLint. Install it once with Node.js 20.19 or later, then run the linter:
npm ci
make lintCI runs both make lint and make test on every pull request.
Install the extension into your local GNOME Shell environment for testing:
make installTo clean build artifacts:
make cleanAll code in this repository must strictly adhere to the upstream GNOME Extension Best Practices and the EGO Review Guidelines. These standards ensure high code quality, prevent memory leaks, maintain process isolation, and facilitate extensions.gnome.org (EGO) reviews.
- Every contribution must represent complete, fully functional, and tested logic—never submit incomplete code, placeholder stubs, or empty lifecycle methods.
- The project is maintained by JavaScript/GJS practitioners; code should be idiomatic modern ES Modules / GJS.
- Strict Resource Ownership: Every class must manage its own resources. If a class connects a GObject signal, creates a GLib timeout, allocates a
Soup.Session, or instantiates aGio.Cancellable, that same class must clean it up in itsdestroy()method. Avoid "spaghetti cleanup" where one class allocates and another cleans up. - No Destruction Flags: Do not use boolean flags like
this._destroyedorthis._enabledto guard against race conditions or improper lifecycle calls. Oncedestroy()is called, the instance should be nulled out and never accessed again. - Destruction Order: In custom
destroy()methods, clean up in the following order:- Remove active timeouts and GLib sources (
GLib.Source.remove()). - Disconnect all signal handlers.
- Release child references and resources.
- Call
super.destroy()as the final step.
- Remove active timeouts and GLib sources (
// Correct destruction pattern
destroy() {
if (this._sourceId) {
GLib.Source.remove(this._sourceId);
this._sourceId = null;
}
if (this._signalId && this._object) {
this._object.disconnect(this._signalId);
this._signalId = null;
}
if (this._cancellable) {
this._cancellable.cancel();
this._cancellable = null;
}
this._childComponent?.destroy();
this._childComponent = null;
super.destroy();
}- Always remove any existing GLib source/timer before creating a new one, and place the removal check directly next to the creation call.
- Reset the stored source ID to
nullimmediately upon removal or when the source callback returnsGLib.SOURCE_REMOVE.
// Bad: Source removal separated from creation or omitted
this._sourceId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 5, () => { ... });
// Correct: Source removed immediately before creation
if (this._sourceId) {
GLib.Source.remove(this._sourceId);
this._sourceId = null;
}
this._sourceId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 5, () => {
// ...
return GLib.SOURCE_CONTINUE;
});- Do not wrap standard operations in
try-catchblocks if they never throw unhandled exceptions during normal execution. - Standard methods such as
destroy(),connect(),disconnect(),abort(), andGLib.Source.remove()do not throw errors when used properly.
// Bad
if (this._sourceId) {
try {
GLib.Source.remove(this._sourceId);
} catch (e) {
}
this._sourceId = null;
}
// Correct
if (this._sourceId) {
GLib.Source.remove(this._sourceId);
this._sourceId = null;
}- Target the supported GNOME Shell versions (45–50+) cleanly.
- Do not use optional chaining (
?.()) or function type checks (typeof this.method === 'function') for guaranteed methods or built-in standard APIs.
// Bad: Redundant defensive check for guaranteed method
if (typeof this.updateUI === 'function') {
this.updateUI();
}
// Correct
this.updateUI();GNOME Shell extensions run across two distinct process environments:
- Shell Process (
extension.jsandsrc/ui/): Runs inside the GNOME Shell compositor process with access toSt,Clutter,Meta, andShell. - Preferences Process (
prefs.js): Runs as an out-of-process GTK4 application with access toGtkandAdw.
Rules:
- Shared utility modules (such as
src/models/,src/api/,src/utils/) imported by both processes must never importSt,Clutter,Gtk,Gdk, orAdw. - Keep modules cleanly segregated by directory (e.g.,
src/ui/for Shell UI,prefs.jsfor preferences).
- Minimal Entry Point: Keep
extension.jsminimal. Delegate domain logic, UI creation, and API communication to modular classes undersrc/. - Adjacent Lifecycle Methods: Keep
enable()anddisable()methods next to each other in the extension entry point class so that reviewers can easily verify symmetry of initialization and teardown. - Settings Schema ID: Define
settings-schemainmetadata.jsonand callthis.getSettings()in the entry point without passing hardcoded schema IDs.
- Icons: Use
St.Icon(oricon_name) for GNOME Shell UI andGtk.Imagefor preferences. Never use Unicode emojis as UI icons. - Progress: Use standard Shell UI components (such as
ui.BarLevelor customSt.Binwidgets) rather than ASCII art progress bars (e.g.█░░).
- Avoid spawning external shell processes where native GJS/GLib/Gio APIs exist.
- Use asynchronous Gio APIs or D-Bus for communicating with system services or external background processes to avoid blocking the Shell main loop.
- Self-Documenting Code: Use clear, descriptive variable and function names. Avoid redundant comments that explain basic JavaScript syntax or narrate code line-by-line.
- Line Length: Keep line lengths reasonable (under 200 characters) to avoid horizontal scrolling in EGO review tools.
- Code Duplication: Extract common logic into modular helper functions rather than duplicating code blocks.
- No Credential Logging: Personal Access Tokens, API keys, passwords, and authorization headers must never be written to logs (
console.log,console.warn,console.error), stdout/stderr, or files. - Redaction & Sanitization: Any diagnostic features (such as log exporters) must redact tokens and credentials before presenting or writing output.
- Keyring Storage: All user credentials must be stored solely via
Secret(src/api/keyring.js), never in GSettings or plain text files.
- Branch Naming: Use descriptive branch names like
feat/team-review-toggleorfix/graphql-null-check. - Best Practices: Ensure all code complies with the GNOME Extension Best Practices.
- Test Coverage: When adding features or fixing bugs, add corresponding unit tests in
tests/. - Check Build: Ensure
make testandmake lintrun cleanly without errors. - PR Titles & Commit Messages: Ensure pull request titles and commit messages adhere to the Conventional Commits specification. An automated GitHub Actions workflow validates PR titles on creation and updates.
- PR Description: Clearly describe what changes were made, why they are needed, and how they were tested.
This project uses Google Release Please to automate release tracking, semantic versioning, and changelog generation.
- Commit-Driven Releases: Whenever changes are merged to the
mainbranch, Release Please parses all Conventional Commits since the previous release. - Release PR: Release Please automatically creates or updates an open Release PR (e.g.
chore(main): release 0.2.0). This PR bumps the version inpackage.json,package-lock.json,metadata.json(version-name),.release-please-manifest.json, and records the changes inCHANGELOG.md. - Automated Publishing & Assets: When the Release PR is merged into
main:- Release Please tags the release and creates a GitHub Release with formatted release notes.
- The release workflow automatically runs
make packand attaches the extension zip package (github-pr-tracker@dan.arndt.ca.shell-extension.zip) as a release asset.