Skip to content

feat(roadmap-planner): W5 — rename pull_requests.epic_key to jira_key#191

Merged
danielfbm merged 1 commit into
mainfrom
feat/metrics-w5-jira-key-rename
May 19, 2026
Merged

feat(roadmap-planner): W5 — rename pull_requests.epic_key to jira_key#191
danielfbm merged 1 commit into
mainfrom
feat/metrics-w5-jira-key-rename

Conversation

@danielfbm

Copy link
Copy Markdown
Contributor

Misnomer cleanup from the 2026-05-19 audit (finding B8).

Why

pull_requests.epic_key was named for Epics but the linker regex [A-Z]+-\d+ pulls any matching Jira key from the source branch / title. In a prod sample of 4411 linked PRs, the distribution was:

issue type count
Story 2817
Bug 996
Job 199
Technical Debt 195
Document 118
Sub-task 57
Task 25
Improvement 4
Epic 0

Zero of the linked rows ever pointed at an Epic. The misnomer was load-bearing in sprintCounts — happens to work because most sprint members are Stories.

Diff

File Change
migrations/0006_rename_epic_key_to_jira_key.sql ALTER TABLE pull_requests RENAME COLUMN epic_key TO jira_key (portable: SQLite ≥3.25 + Postgres). Drops idx_pr_epic, recreates idx_pr_jira.
storage/store.go PullRequest.EpicKeyJiraKey. No alias.
storage/generic.go UPSERT SQL + ExecContext args.
github/sync.go + gitlab/sync.go Field assignment in the PR record.
contributions/service_extras.go sprintCounts join + comments.
storage/store_test.go Fixture field.

JSON tag

The tag flips from epic_keyjira_key. We grep'd frontend/ — no consumer reads it. The PR list endpoint never exposed it; only counts are surfaced.

Test plan

  • go test ./... — green
  • go vet ./... — clean
  • Existing TestStoreRoundtrip uses the renamed field
  • Dev deploy: confirm migration applies and existing rows survive

Unlocks

  • W9cross_pillar_review_pct rewrite walks pull_requests.jira_key → issue components → pillars.

🤖 Generated with Claude Code

@alaudabot

Copy link
Copy Markdown
Contributor

🤖 AI Code Review

Property Value
Model opencode/minimax-m2.5-free
Style strict
Issues Found 0
Config Source centralized
Profile ❌ Not Found
Personalized Prompt ❌ No
Prompt Path .github/review/profiles/alaudadevops/toolbox/pr-review.md
Alauda Skills ✅ base-acp-operator-list, base-acp-operator-release, base-authoring, base-m365, base-ocp-operator-list, base-skill-setup, builders-alauda-component-e2e-release, builders-alauda-component-upgrade, builders-alauda-pipeline, builders-claudetask-submit, builders-component-knowledge, builders-confluence, builders-dev-mesh-qa, builders-edge-ci-trace, builders-gitlab-ops, builders-helm-operator-generator, builders-install-cluster-plugin, builders-jira, builders-notify-wecom, builders-olm-operator-lifecycle, builders-prd-to-testcase, builders-publish-errata, builders-roadmap-studio, builders-story-split, builders-violet, builders-webapp-testing, cross-repo-add-mirror, cross-repo-publish, devops-add-bug-release-notes, devops-autodns, devops-bundle-csv-baseline-diff, devops-candidate-version-supervisor, devops-connectors-acceptance-test, devops-connectors-explore, devops-connectors-poc-case, devops-connectors-review, devops-connectors-unit-test, devops-connectors-upgrade-test, devops-connectors-write-user-docs, devops-creating-tekton-pipelines, devops-fix-go-vulns, devops-fork-alauda-binary-release, devops-gen-advanced-form-descriptors, devops-jira-rfd-acceptance, devops-knowledge-adoption, devops-pr-review, devops-refresh-containerfile-digests, devops-refresh-containerfile-tags, devops-replace-strings, devops-scan-docker-keywords, devops-sync-alauda-github-releases, devops-tekton-dynamic-form-optimizer, devops-tekton-operator-task-e2e, devops-tekton-pipeline-delivery, devops-tekton-refresh-results-tag, devops-tekton-task-delivery, devops-tekton-task-overview-template, devops-tekton-task-version-upgrade, devops-tekton-upgrade-notes, devops-tool-report-troubleshoot, devops-ui-e2e-code-audit, devops-ui-e2e-fix-base-on-report, devops-ui-e2e-regression-and-fix, devops-ui-generate-e2e-from-feature, devops-ui-pre-setup, devops-upgrade-go, devops-upstream-backport-cve, devops-upstream-upgrade
Reviewed at 2026-05-19 15:49:41 UTC

Summary

This PR renames the pull_requests.epic_key column to jira_key across the codebase. The change is well-justified with production data showing zero of 4,411 linked PRs actually pointed at an Epic. The implementation is thorough, updating all Go struct references, SQL queries, and comments consistently.

Review Statistics

Category Count
Critical Issues 0
Warnings 0
Suggestions 1
Files Reviewed 8

Critical Issues

Issues that MUST be addressed before merging (security, bugs, breaking changes)

None.

Warnings

Issues that SHOULD be addressed but are not blocking

None.

Suggestions

Recommendations for improvement (nice to have)

  • [roadmap-planner/docs/team-analytics/CHANGES.md:1] Consider adding a brief entry at the top referencing the audit finding ID (B8) from the original audit report for easier traceability, in addition to the existing "Audit cross-reference" footnotes.

Positive Feedback

  • Excellent commit message and PR description with concrete production data supporting the rename
  • Migration is portable across SQLite (>=3.25) and PostgreSQL
  • Comprehensive coverage: all Go code, SQL queries, comments, and test fixtures updated
  • Well-documented CHANGES.md file for operators explaining the behavior change
  • Struct field comment updated to explain the JiraKey is not restricted to Epics
  • Test fixture properly updated to use the new JiraKey field name

Review performed by: alaudabot


ℹ️ About this review

This review was automatically generated using the run-actions workflow.

  • Shared prompt: .github/prompts/code-review.md
  • Config source: centralized
  • Profile path: Not Found
  • Profile ref: e75e733e9aa1b417a8b3c6441e53495dbcb418ad
  • No repository-specific prompt configured
  • Alauda skills: base-acp-operator-list, base-acp-operator-release, base-authoring, base-m365, base-ocp-operator-list, base-skill-setup, builders-alauda-component-e2e-release, builders-alauda-component-upgrade, builders-alauda-pipeline, builders-claudetask-submit, builders-component-knowledge, builders-confluence, builders-dev-mesh-qa, builders-edge-ci-trace, builders-gitlab-ops, builders-helm-operator-generator, builders-install-cluster-plugin, builders-jira, builders-notify-wecom, builders-olm-operator-lifecycle, builders-prd-to-testcase, builders-publish-errata, builders-roadmap-studio, builders-story-split, builders-violet, builders-webapp-testing, cross-repo-add-mirror, cross-repo-publish, devops-add-bug-release-notes, devops-autodns, devops-bundle-csv-baseline-diff, devops-candidate-version-supervisor, devops-connectors-acceptance-test, devops-connectors-explore, devops-connectors-poc-case, devops-connectors-review, devops-connectors-unit-test, devops-connectors-upgrade-test, devops-connectors-write-user-docs, devops-creating-tekton-pipelines, devops-fix-go-vulns, devops-fork-alauda-binary-release, devops-gen-advanced-form-descriptors, devops-jira-rfd-acceptance, devops-knowledge-adoption, devops-pr-review, devops-refresh-containerfile-digests, devops-refresh-containerfile-tags, devops-replace-strings, devops-scan-docker-keywords, devops-sync-alauda-github-releases, devops-tekton-dynamic-form-optimizer, devops-tekton-operator-task-e2e, devops-tekton-pipeline-delivery, devops-tekton-refresh-results-tag, devops-tekton-task-delivery, devops-tekton-task-overview-template, devops-tekton-task-version-upgrade, devops-tekton-upgrade-notes, devops-tool-report-troubleshoot, devops-ui-e2e-code-audit, devops-ui-e2e-fix-base-on-report, devops-ui-e2e-regression-and-fix, devops-ui-generate-e2e-from-feature, devops-ui-pre-setup, devops-upgrade-go, devops-upstream-backport-cve, devops-upstream-upgrade

Misnomer cleanup from the 2026-05-19 audit (finding B8). The column
was named for Epics but the linker regex pulls *any* DEVOPS-NNN key
from the source branch / title — in prod 4411 linked PRs, zero point
at an actual Epic (Story 2817, Bug 996, Job 199, ...).

- Migration 0006_rename_epic_key_to_jira_key.sql: portable RENAME
  COLUMN (SQLite >=3.25 + Postgres), drops idx_pr_epic, recreates
  idx_pr_jira.
- storage.PullRequest.EpicKey -> JiraKey, no alias.
- All callers in github/gitlab sync, storage upsert, sprintCounts
  JOIN, and the storage round-trip test update in lock-step.

The JSON tag was internal-only (no frontend / external consumer reads
it; PR list endpoint never exposed it). Safe one-shot rename.

Unlocks W9 (cross-pillar % rewrite uses jira_key to walk to issue
components).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@danielfbm danielfbm force-pushed the feat/metrics-w5-jira-key-rename branch from 3c96cf0 to 520cc4a Compare May 19, 2026 22:17
@danielfbm danielfbm merged commit d54fe8c into main May 19, 2026
@danielfbm danielfbm deleted the feat/metrics-w5-jira-key-rename branch May 19, 2026 22:17
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.

2 participants