Skip to content

feat(roadmap-planner): W6 — flip gitlab.hydrate_diff default to true - #192

Merged
danielfbm merged 1 commit into
mainfrom
feat/metrics-w6-gitlab-parity
May 19, 2026
Merged

danielfbm merged 1 commit into
mainfrom
feat/metrics-w6-gitlab-parity

Conversation

@danielfbm

Copy link
Copy Markdown
Contributor

Audit follow-up B12 / Q12 — 2026-05-19.

Summary

  • gitlab.NewSyncer initialises HydrateDiff: true (was false).
  • viper default for gitlab.hydrate_diff flipped to true.
  • TestSyncerHydrateDiffDefault pins the new default.

Why

Merged-MR additions / deletions / changed_files feed the Dashboard tab. GitHub already collects them every cycle (returned inline on the list endpoint); GitLab needed a separate show-MR call. The asymmetry meant Dashboard counts only included GitHub-side activity. With hydrate_diff on by default, both sides feed the panel.

Cost is ~+1 extra API call per merged MR; ~+2% of the per-cycle GitLab API budget. Per maintainer (Q12), the one-shot backfill cost is fine to absorb overnight.

Already on main

The "skip review fetch for draft MRs" mirror (W6 design item 2) is already in gitlab/sync.go — drafts and WIP MRs are skipped via skipNotes := mr.Draft || mr.WorkInProg. This PR only flips the diff default.

Deferred

changes_requested review-state marker for GitLab (Q5) — Q5 answer was "defer, we generally don't do that in gitlab."

Test plan

  • go test ./... + go vet ./... — green
  • TestSyncerHydrateDiffDefault pins the constructor default
  • Dev deploy: confirm pull_requests.additions/deletions/changed_files populate on the next GitLab cycle

Rollback

gitlab.hydrate_diff: false in the ConfigMap.

🤖 Generated with Claude Code

Audit follow-up B12 / Q12 (2026-05-19). Merged-MR diff stats
(additions / deletions / changed_files) feed the Dashboard tab and
the GitHub side collects them on every cycle. Asymmetry is now
fixed: the GitLab default flips on too.

- gitlab.Syncer.HydrateDiff initialised to true in NewSyncer.
- viper default for `gitlab.hydrate_diff` flipped to true.
- TestSyncerHydrateDiffDefault pins the new default so a future
  refactor doesn't silently flip it back.

Cost is ~+1 extra API call per merged MR; ~+2% of the per-cycle
GitLab API budget. Operators on tight rate limits can disable via
`gitlab.hydrate_diff: false` in the ConfigMap.

The draft-skip mirror (W6 design item 2) is already in main —
gitlab/sync.go already skips notes for `mr.Draft || mr.WorkInProg`.

`changes_requested` review-state marker for GitLab (Q5) is deferred.

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

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@@ -0,0 +1,215 @@
# Team Analytics — Behaviour Changes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion (docs/missing): Consider adding a brief file-level comment indicating this is part of the audit follow-up from 2026-05-19 (e.g., `# Team Analytics — Behaviour Changes

Audited: 2026-05-19
Plan: docs/team-analytics/audit-2026-05-19/PLAN.md`). This helps future readers understand the context.

@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:52:49 UTC

Summary

This PR flips the default value of gitlab.hydrate_diff from false to true, enabling GitLab parity with GitHub for fetching merged MR additions/deletions/changed_files. The changes are minimal, well-documented, and include a test to guard the new default.

Review Statistics

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

Warnings

  • [config.go:182-184] The struct comment for GitLab.HydrateDiff says "Off by default" but the default has been flipped to true. This documentation is now outdated. Consider updating: "HydrateDiff turns on per-merged-MR additions/deletions/changes_count fetches. Enabled by default since W6 (2026-05-19) — the Dashboard tab consumes the data and the cost is ~+2% of the per-cycle GitLab API budget."

Suggestions

  • [CHANGES.md:1] Consider adding a brief header comment at the top indicating this file is part of the audit follow-up from 2026-05-19, matching the PR description. This helps future readers understand the context.

Positive Feedback

  • The code changes are minimal and focused - only what's necessary to flip the default.
  • The comment added in sync.go (lines 90-95) is comprehensive, explaining the change rationale, cost implications, and rollback instructions.
  • The new test TestSyncerHydrateDiffDefault properly guards the default from accidentally flipping back.
  • The new CHANGES.md file is well-structured and provides excellent operator-facing documentation with clear "What changed", "Why", "Rollback" sections.
  • Error handling in the hydration logic (line 260) is graceful - failures don't break the sync, they just leave fields at zero.

Review: This PR is ready to merge. The warning is non-blocking but should be addressed for documentation consistency.


ℹ️ 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

@danielfbm
danielfbm merged commit 9b98603 into main May 19, 2026
14 checks passed
@danielfbm
danielfbm deleted the feat/metrics-w6-gitlab-parity branch May 19, 2026 22:15
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