You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/10/06 21:55:11 UTC
[PR] feat(contributor-growth): name contract operations instead of gh; Jira as a tracker backend [magpie]
potiuk opened a new pull request, #1549:
URL: https://github.com/apache/magpie/pull/1549
## What
The contributor-growth family called `gh` directly in about 30 places, and its counting engine, `contributor-metrics`, was hard-wired to GitHub.
After this PR the skills name **capability-contract operations**, GitHub is one adapter for them, and Jira is a second backend for the tracker side.
A project that reviews on GitHub and files issues in Jira now gets correct contributor activity from both.
Follows #1548 (the optimization pass on the same family).
### Contract operations added
| Contract | Operations | Spec |
|---|---|---|
| `contract:change-request` | `list_authored`, `list_reviews_given` (counts and lengths, never bodies), `list_authored_commits` (with a `signed_off_by` flag for DCO) | `tools/change-request/README.md` |
| `contract:tracker` | `list_filed`, `list_triaged`, `list_commented`, `list_created`, `first_reply` | new minimal spec `tools/tracker/README.md` |
| `contract:source-control` | `repository_metadata`, `put_file` | `tools/github/source-control.md` |
| **`contract:people`** (new) | `get_profile`, `list_collaborators`, `add_team_member` (the one write, confirmation-gated) | new `tools/people/README.md` |
The GitHub resolutions of every operation live in `tools/github/operations.md`.
### Adapter coverage
| | GitHub | Jira |
|---|---|---|
| change-request activity | yes | no PR model |
| tracker activity (all five) | yes | yes |
| source-control metadata and write | yes | n/a |
| `get_profile` | yes | yes (display name, existence) |
| `list_collaborators`, `add_team_member` | yes | no such concept |
GitLab, Forgejo and Bitbucket already implement the base contracts; their adapters for the new operations are follow-ups using the same seam.
### `contributor-metrics`
`fetch` now has two sides: the **code host** (PRs, reviews, PR threads) and the **tracker** (issues filed, triaged and commented on).
- **GitHub on both sides:** output is byte-for-byte what it was. There is no new key, the cache keys are the same, and all existing tests pass unchanged.
- **Jira as tracker:**
- The tracker is configured from the same `<project-config>/issue-tracker-config.md` other skills read; flags and environment variables can override it.
- `--tracker-login` covers a Jira username that differs from the GitHub handle.
- **Jira client:** a new stdlib-only, GET-only client, `jira_bridge.rest` in `tools/jira`. Keeping it there leaves the substrate tool free of network code.
### Jira token handling
The token is the user's personal credential, while the Jira URL comes from project configuration, which may be committed.
So the client:
- requires `https://`, allowing `http://` only for loopback;
- sends the token only to a host the user confirmed (`JIRA_API_HOST`, or a `host=` line in `~/.config/apache-magpie/jira-token`), and only on requests to that host. Otherwise it reads anonymously and says why;
- refuses redirects;
- never puts the token in an error message.
Each rule has a test, including a loopback redirect that must not reach the second server.
**Upgrade note:** an existing Jira token without a confirmed host is no longer sent. Add `host=` or set `JIRA_API_HOST`.
### Still GitHub-only
- **GitHub Discussions,** an optional signal outside every contract. It is marked as GitHub-adapter-only.
- **The `github-codeowners` governance model,** which is GitHub by definition; its operation still goes through `contract:people`.
- **Change-request activity on non-GitHub forges,** which is a follow-up.
## Testing
- Evals for every touched skill: 129 before (3 failing, all known flakes) → 145/145 after, including a new `activity-sweep` case with issues from Jira and PRs from GitHub that keeps the same card shape.
- `tools/contributor-metrics`: 77 tests. `tools/jira` has new client tests. ruff and mypy are clean.
- Validator exit 0 with the same SOFT warnings as main; capability-sync is clean.
- `prek run --all-files` is green.
- Vendor neutrality:
- skills capability-pure 19 → 22; this family 3 → 6;
- contracts green 12/15; `contract:people` is green on GitHub + Atlassian;
- no skill is vendor-coupled.
The `contract:people` label needs creating on the repository.
---
Gen-AI disclosure: prepared with the assistance of Claude Code (Claude Opus 5); reviewed by the author.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(contributor-growth): name contract operations instead of gh; Jira as a tracker backend [magpie]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #1549:
URL: https://github.com/apache/magpie/pull/1549
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org