Skip to content

Conversation

@olemartinorg
Copy link
Contributor

@olemartinorg olemartinorg commented Jan 22, 2026

Description

The gh release list command sorts by when a release was created, not when it was published. This caused it to backport fixes to v4.24.x right now, instead of v4.25.x.

Example output from running gh release list --limit 3 --exclude-pre-releases --exclude-drafts --json tagName,publishedAt,createdAt:

[
  {
    "createdAt": "2026-01-14T13:56:25Z",
    "publishedAt": "2026-01-14T13:59:00Z",
    "tagName": "v4.24.2"
  },
  {
    "createdAt": "2026-01-14T13:26:34Z",
    "publishedAt": "2026-01-15T13:28:55Z",
    "tagName": "v4.25.0"
  },
  {
    "createdAt": "2025-12-15T06:31:31Z",
    "publishedAt": "2025-12-15T08:03:08Z",
    "tagName": "v4.24.1"
  }
]

This problem happened because v4.24.2 was released after the draft-release for v4.25.0 was created.

This fix gets the last 10 releases and sorts them by published date first.

Related Issue(s)

  • closes #{issue number}

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* and backport* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Summary by CodeRabbit

  • Chores
    • Improved release tag selection logic in automated workflows for better accuracy when managing multiple releases.

✏️ Tip: You can customize this high-level summary in your review settings.

…not the last created one (long-lasting drafts such as v4.25.0 would cause issues)
@olemartinorg olemartinorg added kind/bug Something isn't working taskforce/next Issues that belongs to the named task-force labels Jan 22, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

The GitHub Actions workflow now fetches up to 10 releases and determines the latest by sorting releases by their publication timestamp in descending order, rather than selecting the first from a single-release query.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/auto-backport.yml
Modified release lookup to fetch multiple releases and sort by publishedAt timestamp in descending order; changed from first tagName selection to selection based on latest publication date

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the specific fix: using v4.25.0 as the latest release in the auto-backport workflow, matching the core change in the PR.
Description check ✅ Passed The description includes a detailed explanation of the problem (gh release list sorts by creation date), concrete examples with JSON output, root cause analysis, and the implemented fix. Most required template sections are completed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/auto-backport-wrong-release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@olemartinorg olemartinorg added the backport-ignore This PR is a new feature and should not be cherry-picked onto release branches label Jan 22, 2026
Copy link
Contributor

@cammiida cammiida left a comment

Choose a reason for hiding this comment

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

👌

@olemartinorg olemartinorg merged commit ad82271 into main Jan 22, 2026
4 of 7 checks passed
@olemartinorg olemartinorg deleted the bug/auto-backport-wrong-release branch January 22, 2026 14:00
@github-project-automation github-project-automation bot moved this from 🔎 In review to ✅ Done in Team Altinn Studio Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-ignore This PR is a new feature and should not be cherry-picked onto release branches kind/bug Something isn't working taskforce/next Issues that belongs to the named task-force

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants