Skip to content

[TT-16950] fix: dashboard resolver matches release branches (release-5.12)#8044

Merged
buger merged 1 commit intorelease-5.12from
hotfix/fix-dashboard-resolver-5.12
Apr 16, 2026
Merged

[TT-16950] fix: dashboard resolver matches release branches (release-5.12)#8044
buger merged 1 commit intorelease-5.12from
hotfix/fix-dashboard-resolver-5.12

Conversation

@buger
Copy link
Copy Markdown
Member

@buger buger commented Apr 16, 2026

Summary

  • For release branch PRs, the dashboard resolver now checks if the base branch exists in tyk-analytics and uses it directly
  • Previously any non-master BASE_REF immediately got strategy=gromit-default, which mapped to tyk-analytics:master -- causing test failures due to dashboard/test version mismatch
  • Adds ORG_GH_TOKEN to the resolver step env for git ls-remote authentication

Test plan

  • Verify PR targeting release-5.12 resolves to tyk-analytics:release-5.12 via release-branch-match strategy
  • Verify PR targeting a non-existent release branch falls back to gromit-default

Generated with Claude Code

For PRs targeting release branches, check if the same branch exists
in tyk-analytics and use it instead of falling back to master.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@buger buger requested a review from a team as a code owner April 16, 2026 15:15
@github-actions
Copy link
Copy Markdown
Contributor

🚨 Jira Linter Failed

Commit: 5f1063c
Failed at: 2026-04-16 15:16:17 UTC

The Jira linter failed to validate your PR. Please check the error details below:

🔍 Click to view error details
failed to validate branch and PR title rules: branch name 'hotfix/fix-dashboard-resolver-5.12' must contain a valid Jira ticket ID (e.g., ABC-123)

Next Steps

  • Ensure your branch name contains a valid Jira ticket ID (e.g., ABC-123)
  • Verify your PR title matches the branch's Jira ticket ID
  • Check that the Jira ticket exists and is accessible

This comment will be automatically deleted once the linter passes.

@probelabs
Copy link
Copy Markdown
Contributor

probelabs Bot commented Apr 16, 2026

This PR fixes a bug in the release.yml GitHub Actions workflow that caused incorrect test failures for pull requests targeting release branches.

Files Changed Analysis

  • File: .github/workflows/release.yml
  • Changes: 17 additions, 7 deletions.
  • Summary: The changes introduce new logic within the "Dashboard Image Resolution" step. A simple check for the master branch is replaced with a more robust mechanism that inspects the tyk-analytics repository for a matching release branch.

Architecture & Impact Assessment

What this PR accomplishes:
This PR ensures that when a pull request targets a release branch (e.g., release-5.12), the CI pipeline uses the corresponding version of the Tyk Dashboard (tyk-analytics:release-5.12) for integration tests. Previously, it would default to tyk-analytics:master, leading to version mismatches and test failures.

Key technical changes introduced:

  • The workflow now uses git ls-remote to check if the PR's base branch exists in the TykTechnologies/tyk-analytics repository.
  • The ORG_GH_TOKEN secret is now passed to the step to authenticate the git command against the private tyk-analytics repository.
  • A new resolution strategy, release-branch-match, is introduced for when a corresponding release branch is found.

Affected system components:

  • The primary impact is on the CI/CD pipeline for this repository, specifically the integration tests that depend on the Tyk Dashboard.
  • It improves the reliability of testing for release branches, ensuring that gateway changes are validated against the correct dashboard version.

Workflow Logic:

graph TD
    A[Start: Resolve Dashboard Image] --> B{"PR base branch is 'master'?"};
    B -- Yes --> C[Use existing master branch logic];
    B -- No --> D{Does matching branch exist in tyk-analytics?};
    D -- Yes --> E[Use matching branch image, e.g., tyk-analytics:release-5.12];
    D -- No --> F["Fallback to default (master) image"];
Loading

Scope Discovery & Context Expansion

This change is confined to the CI configuration but has implications for the multi-repository release process involving tyk and tyk-analytics. It codifies the assumption that release branches are maintained in parallel across both repositories. The dashboard_image output from this step is consumed by subsequent jobs in the workflow that run integration tests, which will now receive the correctly versioned dashboard image. The introduction of ORG_GH_TOKEN highlights the dependency and need for authentication between these two core component repositories during the CI process.

Metadata
  • Review Effort: 2 / 5
  • Primary Label: bug

Powered by Visor from Probelabs

Last updated: 2026-04-16T15:17:45.568Z | Triggered by: pr_opened | Commit: 5f1063c

💡 TIP: You can chat with Visor using /visor ask <your question>

@probelabs
Copy link
Copy Markdown
Contributor

probelabs Bot commented Apr 16, 2026

\n\n

Architecture Issues (1)

Severity Location Issue
🟡 Warning .github/workflows/release.yml:518-529
The script assumes any failure of the `git ls-remote` command means the branch does not exist. The command can also fail due to other reasons like invalid credentials or network issues. In these failure scenarios, the log message at line 526 ('base branch ... not found') would be misleading, making it harder to diagnose problems with secrets or connectivity.
💡 SuggestionDistinguish between the 'branch not found' exit code (2) and other error codes from `git ls-remote`. Log a more specific warning for unexpected errors to aid troubleshooting.
if git ls-remote --exit-code --heads &#34;https://x-access-token:${ORG_GH_TOKEN}@github.com/TykTechnologies/tyk-analytics.git&#34; &#34;refs/heads/$BASE_REF&#34; &gt; /dev/null 2&gt;&amp;1; then
  echo &#34;📋 Strategy: Use release branch &#39;$BASE_REF&#39; from tyk-analytics&#34;
  echo &#34;    → Base branch exists in tyk-analytics, using it directly&#34;
  echo &#34;dashboard_image=${REGISTRY}/tyk-analytics:${BASE_REF}&#34; &gt;&gt; $GITHUB_OUTPUT
  echo &#34;needs_build=false&#34; &gt;&gt; $GITHUB_OUTPUT
  echo &#34;dashboard_branch=$BASE_REF&#34; &gt;&gt; $GITHUB_OUTPUT
  echo &#34;strategy=release-branch-match&#34; &gt;&gt; $GITHUB_OUTPUT
else
  exit_code=$?
  if [ $exit_code -eq 2 ]; then
    echo &#34;ℹ️ Strategy: Use gromit default (base branch &#39;$BASE_REF&#39; not found in tyk-analytics)&#34;
  else
    echo &#34;::warning::&#39;git ls-remote&#39; failed with exit code $exit_code. This could be an authentication or network issue. Falling back to gromit default.&#34;
  fi
  echo &#34;    → Falling back to gromit default&#34;
  echo &#34;dashboard_image=&#34; &gt;&gt; $GITHUB_OUTPUT
  echo &#34;needs_build=false&#34; &gt;&gt; $GITHUB_OUTPUT
  echo &#34;dashboard_branch=&#34; &gt;&gt; $GITHUB_OUTPUT
  echo &#34;strategy=gromit-default&#34; &gt;&gt; $GITHUB_OUTPUT
fi

✅ Performance Check Passed

No performance issues found – changes LGTM.

Quality Issues (1)

Severity Location Issue
🟡 Warning .github/workflows/release.yml:516
The `git ls-remote` command redirects both stdout and stderr to `/dev/null`. This suppresses potentially useful error messages, such as those related to authentication failures. If the `ORG_GH_TOKEN` is invalid or lacks permissions, the command will fail silently, and the script will incorrectly report that the release branch was not found in `tyk-analytics`, making it difficult to diagnose the root cause of a CI failure.
💡 SuggestionTo improve debuggability, allow stderr from the `git ls-remote` command to be printed to the action log by only redirecting stdout. Change `> /dev/null 2>&1` to `> /dev/null`.

Powered by Visor from Probelabs

Last updated: 2026-04-16T15:17:39.909Z | Triggered by: pr_opened | Commit: 5f1063c

💡 TIP: You can chat with Visor using /visor ask <your question>

@github-actions
Copy link
Copy Markdown
Contributor

API Changes

no api changes detected

@buger buger merged commit e986dab into release-5.12 Apr 16, 2026
19 of 20 checks passed
@buger buger deleted the hotfix/fix-dashboard-resolver-5.12 branch April 16, 2026 15:23
buger added a commit that referenced this pull request Apr 16, 2026
)

## Summary

- For PRs targeting release branches, the dashboard resolver now checks
if the base branch exists in `tyk-analytics` and uses it directly via
ECR image
- Previously always fell back to gromit-default (master), causing test
failures due to dashboard/gateway version mismatch
- Adds `ORG_GH_TOKEN` to the resolve step's env block for authenticated
`git ls-remote` against private `tyk-analytics` repo

Same fix as #8043 (master) and #8044 (release-5.12).

## Test plan

- [ ] CI passes on this PR
- [ ] Verify that PRs targeting `release-5.12.1` correctly resolve
dashboard image from tyk-analytics `release-5.12.1` branch

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

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@buger buger changed the title fix: dashboard resolver matches release branches (release-5.12) [TT-16950] fix: dashboard resolver matches release branches (release-5.12) Apr 21, 2026
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