Skip to content

feat: [CODE-5445]: propagate provider node_id into scm.Repository and scm.PullRequest#357

Open
anurag-harness wants to merge 1 commit into
masterfrom
CODE-5445-add-node-id-to-parsed-webhook
Open

feat: [CODE-5445]: propagate provider node_id into scm.Repository and scm.PullRequest#357
anurag-harness wants to merge 1 commit into
masterfrom
CODE-5445-add-node-id-to-parsed-webhook

Conversation

@anurag-harness

Copy link
Copy Markdown

Summary

Adds a NodeID field to scm.Repository and scm.PullRequest and wires it through the GitHub, GitLab, and Bitbucket drivers so consumers receive a provider-stable identifier alongside the existing numeric/UUID ID.

  • GitHub: maps the GraphQL node_id from REST payloads via convertRepository / convertPullRequest and from all inline webhook converters (push, branch, tag, PR, deployment, issue comment, release). The PR review hook already routes through convertRepository so it picks the field up automatically.
  • GitLab: maps the project-scoped numeric id for repos, and the global MR id (distinct from the project-scoped iid surfaced as Number) for PRs; applied across all webhook converters, including pipeline hooks where MergeRequest.ID is the canonical PR identifier.
  • Bitbucket: maps the repository uuid (already used for ID) and the PR numeric id (stringified) across REST and webhook flows, including push, branch/tag, PR, PR comment, and pipeline hooks.

The change is purely additive — existing consumers see no behavior change. Downstream callers (e.g. harness-core's SCM proto converters) will be updated in a follow-up to surface node_id in WebhookDTO.parsedResponse.

Test plan

  • go test ./... (all driver suites + integration tests pass)
  • go vet ./scm/...
  • Updated ~60 testdata golden fixtures across three drivers to include the new NodeID field
  • Verify downstream harness-core build once this is tagged as a pseudo-version

🤖 Generated with Claude Code

… scm.PullRequest

Adds a NodeID field to scm.Repository and scm.PullRequest and wires it
through the GitHub, GitLab, and Bitbucket drivers so consumers see a
provider-stable identifier alongside the existing numeric/UUID ID:

- GitHub: maps the GraphQL node_id from REST payloads (Repository,
  PullRequest, and inline webhook converters: push, branch, tag, PR,
  deployment, issue comment, release).
- GitLab: maps the project-scoped numeric id for repos and the global MR
  id (distinct from the project-scoped iid surfaced as Number) for PRs;
  applied across all webhook converters, including pipeline hooks where
  MergeRequest.ID is the canonical PR identifier.
- Bitbucket: maps the repository UUID (already used for ID) and the PR
  numeric id (stringified) across REST and webhook flows.

Updates ~60 testdata golden fixtures across the three drivers to
include the new NodeID field. The change is purely additive.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant