Skip to content

ci: skip Cypress on draft pull requests - #4396

Merged
phlipsterit merged 1 commit into
mainfrom
ci/skip-cypress-on-draft-prs
Oct 26, 2026
Merged

phlipsterit merged 1 commit into
mainfrom
ci/skip-cypress-on-draft-prs

Conversation

@phlipsterit

@phlipsterit phlipsterit commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Cypress no longer runs on draft pull requests. It runs when the PR is marked ready for review, and on pushes to main as before. This mirrors Altinn/altinn-studio#18333.

Summary

 jobs:
   install:
+    if: not a draft PR
   cypress-run-internal:
     if: |
+      not a draft PR &&
       owner == 'Altinn' &&
-      (push && not fork) ||
-      (PR && not fork)
+      (
+        (push && not fork) ||
+        (PR && not fork)
+      )
   cypress-run-external:
     if: |
+      not a draft PR &&
       owner == 'Altinn' && PR from fork

The brackets are needed. Without them, draft && owner && X || Y is read as (…) || Y, so non-fork PRs would still run as drafts. They also fix the existing bug where the owner check didn't apply to the non-fork PR case.

A full Cypress run currently takes about 1.5 hours on a single shard. In #4394, three full runs happened: on opening the draft, on a push while it was still a draft, and on ready for review. With this change, only the last one would have run.

Evidence

Merge Danger

Door: two-way

CI config only. Reverting the commit restores the old behaviour.

Blast Radius: CI

Draft PRs no longer get Cypress feedback, so contributors who rely on it before asking for review need to mark the PR ready first, or run Cypress locally. Percy snapshots were already skipped for drafts.

Related Issue(s)

  • None

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
    • Automated checks now skip draft pull requests.
    • Pull-request checks apply the repository ownership requirement consistently for internal runs. Checks for external runs remain limited to qualifying pull requests from forks.

Mirrors altinn-studio#18333. Also groups the fork conditions in the internal
job so the repository owner check applies to both branches of the OR.
@phlipsterit phlipsterit added ignore-for-release Pull requests to be ignored in release notes backport-ignore This PR is a new feature and should not be cherry-picked onto release branches labels Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f3e26465-4c01-41b7-b14d-bdba8ab28da4
📥 Commits

Reviewing files that changed from the base of the PR and between 91a6b3a and 4682cf9.

📒 Files selected for processing: 1
  • .github/workflows/cypress.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The Cypress workflow now skips draft pull requests in its install, internal, and external jobs. The internal job also applies the Altinn repository-owner condition to non-pull-request and non-fork pull-request runs.

Changes: Cypress workflow job conditions

Layer / File(s) Summary
Job conditions
.github/workflows/cypress.yml
The install, internal, and external jobs skip draft pull requests. The internal job applies the Altinn owner condition to non-pull-request and non-fork pull-request runs. The external job retains its Altinn-owned fork pull-request condition.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: olemartinorg

Merge Risk: ⚪ Minimal · up to 4682c

The Cypress workflow change is mergeable with no identified correctness or availability risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: skipping Cypress jobs on draft pull requests.
Description check Passed The description explains the change, affected CI conditions, rationale, expected behavior, impact, verification status, and required checklist items. It identifies that no related issue exists and mar…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the change, affected CI conditions, rationale, expected behavior, impact, verification status, and required checklist items. It identifies that no related issue exists and marks the relevant testing and documentation items.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@phlipsterit
phlipsterit marked this pull request as ready for review October 23, 2026 12:02
@phlipsterit
phlipsterit merged commit 2aa9fcf into main Oct 26, 2026
24 of 25 checks passed
@phlipsterit
phlipsterit deleted the ci/skip-cypress-on-draft-prs branch October 26, 2026 08:07
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 ignore-for-release Pull requests to be ignored in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants