Skip to content

[ci] Refactor Github workflows - #1107

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
refactor-workflows
Jun 24, 2025
Merged

Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
refactor-workflows

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Jun 24, 2025 •

Copy link
Copy Markdown
Member

Signed-off-by: Andrei Kvapil [email protected]

Summary by CodeRabbit

  • New Features

    • Pull request workflows now support release pull requests by fetching artifacts from draft releases and running all jobs without label-based exclusions.
    • Test matrices are now generated dynamically, improving flexibility in end-to-end application testing.
    • Added a new end-to-end test verifying tenant creation with isolated mode enabled.
  • Refactor

    • Workflow steps and job dependencies have been streamlined for improved efficiency and maintainability.
    • Workflow names and concurrency group names have been updated for clarity.
    • Environment preparation and artifact handling have been unified into consolidated jobs.
    • Release-related workflow simplified to a single finalize job.
    • Makefile targets for asset copying and test execution have been reorganized for better modularity.
  • Tests

    • End-to-end application and cluster test scripts have been removed.
    • Removed collective end-to-end test target; individual app test targets remain.

@coderabbitai

coderabbitai Bot commented Jun 24, 2025 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

Andrei Kvapil (@kvaps) has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 35 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 56dc0e8 and e7681de.

📒 Files selected for processing (7)
  • .github/workflows/pull-requests-release.yaml (1 hunks)
  • .github/workflows/pull-requests.yaml (4 hunks)
  • hack/e2e-apps.bats (0 hunks)
  • hack/e2e-apps/tenant.bats (0 hunks)
  • hack/e2e-cluster.bats (0 hunks)
  • hack/e2e-install-cozystack.bats (3 hunks)
  • packages/core/testing/Makefile (1 hunks)

"""

Walkthrough

The pull request refactors GitHub Actions workflows by drastically simplifying the release workflow to only keep the final tagging and release job, removing all intermediate setup and testing jobs. The main pull request workflow is updated to support release PRs, introduces dynamic test matrix generation, and refactors artifact fetching. Additionally, end-to-end Bats test scripts for application provisioning and cluster provisioning are deleted, and a new tenant creation test is added to the Cozystack installation tests.

Changes

File(s) Change Summary
.github/workflows/pull-requests-release.yaml Removed all jobs except the finalize job; changed workflow trigger to only PR closed events; updated concurrency group; simplified workflow.
.github/workflows/pull-requests.yaml Removed setup_tenant job; refactored prepare_env and added install_cozystack job; added detect_test_matrix job; enabled all jobs for release PRs; replaced static test matrix with dynamic matrix.
hack/e2e-apps.bats, hack/e2e-apps/tenant.bats Deleted entire Bats end-to-end application provisioning test script and tenant creation test script.
hack/e2e-cluster.bats Deleted comprehensive cluster provisioning and validation test suite.
hack/e2e-install-cozystack.bats Modified HelmRelease readiness checks to filter system apps; added checks to avoid duplicate LINSTOR pool creation; added new tenant creation test with isolated mode enabled.
packages/core/testing/Makefile Removed the test-apps target that ran all e2e app tests collectively; split asset copying into separate targets for nocloud image and installer manifest.

Sequence Diagram(s)

sequenceDiagram
    participant PR as Pull Request Event
    participant GH as GitHub Actions
    participant Runner as Self-hosted Runner

    PR->>GH: PR closed (with "release" label)
    GH->>Runner: Run finalize job
    Runner->>GH: Checkout repo, extract tag, update branch, publish release
Loading
sequenceDiagram
    participant PR as Pull Request Event
    participant GH as GitHub Actions
    participant Install as install_cozystack
    participant Matrix as detect_test_matrix
    participant Test as test_apps
    participant Cleanup as cleanup

    PR->>GH: PR opened/updated
    GH->>Install: Fetch artifacts (build or draft release), prepare environment
    GH->>Matrix: Generate dynamic test matrix
    Install->>Test: Provide environment
    Matrix->>Test: Provide test matrix
    Test->>Cleanup: Run tests and cleanup
Loading

Possibly related PRs

Suggested labels

ok-to-test, enhancement, size:L

Suggested reviewers

  • lllamnyp
  • klinch0

Poem

🐇 Hopping through workflows, neat and light,
Old jobs vanish, out of sight.
Final tagger stands alone, so bold,
Dynamic tests now take their hold.
Bats scripts rest in peaceful sleep,
This rabbit’s path is clean and deep! ✨🐰
"""

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kvaps
Andrei Kvapil (kvaps) force-pushed the refactor-workflows branch 5 times, most recently from bb6a1f8 to fde3fd3 Compare June 24, 2025 17:47

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/pull-requests.yaml (2)

156-156: Fix trailing spaces.

Remove trailing whitespace to comply with YAML formatting standards.

- 
+

212-212: Fix comma spacing in YAML.

Add proper spacing after the comma to improve readability and comply with YAML formatting standards.

-    needs: [install_cozystack,detect_test_matrix]
+    needs: [install_cozystack, detect_test_matrix]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6cc1f6 and fde3fd3.

📒 Files selected for processing (6)
  • .github/workflows/pull-requests-release.yaml (1 hunks)
  • .github/workflows/pull-requests.yaml (4 hunks)
  • hack/e2e-apps.bats (0 hunks)
  • hack/e2e-apps/tenant.bats (0 hunks)
  • hack/e2e-cluster.bats (1 hunks)
  • packages/core/testing/Makefile (0 hunks)
💤 Files with no reviewable changes (3)
  • hack/e2e-apps/tenant.bats
  • packages/core/testing/Makefile
  • hack/e2e-apps.bats
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/pull-requests.yaml

[error] 156-156: trailing spaces

(trailing-spaces)


[warning] 212-212: too few spaces after comma

(commas)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build
🔇 Additional comments (8)
hack/e2e-cluster.bats (1)

393-412: Well-structured tenant creation test.

The new test case follows good testing practices with proper conditional creation, appropriate wait conditions, and clear resource specifications. The isolated tenant configuration aligns with the test case name and objectives.

.github/workflows/pull-requests-release.yaml (2)

1-5: Workflow simplification improves maintainability.

The refactoring to focus solely on the final release step reduces complexity and potential failure points. The trigger restriction to only closed events is appropriate for a release-focused workflow.


7-10: Concurrency group naming is consistent.

The shortened concurrency group name maintains the same functionality while being more concise, consistent with the main PR workflow changes.

.github/workflows/pull-requests.yaml (5)

9-9: Concurrency group naming is consistent.

The shortened concurrency group name aligns with the release workflow changes and maintains the same functionality.


60-66: Job consolidation improves workflow efficiency.

The merge of environment preparation into the install_cozystack job reduces complexity and eliminates unnecessary job dependencies. The explicit permissions are a good security practice.


78-92: Conditional artifact download logic is well-structured.

The separation between regular PR and release PR artifact handling is clear and appropriate. The path specifications ensure artifacts are placed in the correct directory structure.


193-206: Dynamic test matrix generation is an improvement.

The dynamic detection of test files is more maintainable than static lists and will automatically include new test files as they're added.


93-156: Complex release PR asset fetching needs verification.

The GitHub API integration for fetching draft release assets is sophisticated but adds complexity. Ensure that error handling covers edge cases like missing assets or API failures.

#!/bin/bash
# Description: Verify GitHub API patterns and error handling in workflow scripts

# Search for similar GitHub API usage patterns in the codebase
rg -A 5 -B 5 "github\.rest\.repos\.listReleases"

# Check for error handling patterns around API calls
rg -A 10 "core\.setFailed.*Draft release.*not found"

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (4)
.github/workflows/pull-requests.yaml (4)

7-9: Fix formatting issues

Static analysis detected trailing spaces and formatting issues.

Apply this fix:

-# Cancel in‑flight runs for the same PR when a new push arrives.
+# Cancel in-flight runs for the same PR when a new push arrives.

153-153: Fix trailing spaces

Static analysis detected trailing spaces.

Remove the trailing spaces at the end of line 153.


237-237: Fix trailing spaces

Static analysis detected trailing spaces.

Remove the trailing spaces at the end of line 237.


291-294: Fix comma spacing

Static analysis detected insufficient spacing after comma.

Apply this fix:

-    needs: [install_cozystack,detect_test_matrix]
+    needs: [install_cozystack, detect_test_matrix]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fde3fd3 and 1c5a302.

📒 Files selected for processing (7)
  • .github/workflows/pull-requests-release.yaml (1 hunks)
  • .github/workflows/pull-requests.yaml (3 hunks)
  • hack/e2e-apps.bats (0 hunks)
  • hack/e2e-apps/tenant.bats (0 hunks)
  • hack/e2e-cluster.bats (0 hunks)
  • hack/e2e-install-cozystack.bats (3 hunks)
  • packages/core/testing/Makefile (0 hunks)
💤 Files with no reviewable changes (4)
  • packages/core/testing/Makefile
  • hack/e2e-apps/tenant.bats
  • hack/e2e-apps.bats
  • hack/e2e-cluster.bats
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/pull-requests-release.yaml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/pull-requests.yaml

[error] 153-153: trailing spaces

(trailing-spaces)


[error] 237-237: trailing spaces

(trailing-spaces)


[warning] 294-294: too few spaces after comma

(commas)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build
🔇 Additional comments (5)
hack/e2e-install-cozystack.bats (3)

23-25: LGTM: Improved HelmRelease filtering for system applications

The addition of the cozystack.io/system-app=true label filter makes the tests more focused and targeted by only checking system applications. This reduces noise and improves test reliability.


45-49: LGTM: Defensive programming for storage pool creation

The logic to check for existing storage pools before creation is a good defensive programming practice that prevents errors when the script is run multiple times. The implementation correctly parses the LINSTOR output to identify existing pools.


163-182: LGTM: Consolidated tenant creation test

This new test case effectively consolidates tenant creation testing that was previously in separate scripts. The test properly creates a tenant with isolated mode and waits for the appropriate conditions.

.github/workflows/pull-requests.yaml (2)

275-287: LGTM: Dynamic test matrix generation

The new detect_test_matrix job that dynamically generates the test matrix by scanning e2e app scripts is a significant improvement over static matrices. This makes the workflow more maintainable and automatically adapts to new test files.


86-99: Verify branch name pattern matching for release PRs

The regex pattern ^release-(\d+\.\d+\.\d+(?:[-\w\.]+)?)$ should handle various release branch formats correctly, but ensure it covers all expected patterns used in your repository.

#!/bin/bash
# Check recent release branches to verify the pattern matches correctly
git branch -r | grep -E 'origin/release-' | head -10

Comment thread .github/workflows/pull-requests.yaml
@kvaps
Andrei Kvapil (kvaps) force-pushed the refactor-workflows branch 6 times, most recently from 405bbe9 to 4242973 Compare June 24, 2025 19:34

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

♻️ Duplicate comments (1)
.github/workflows/pull-requests.yaml (1)

169-235: Significant code duplication with prepare_env job.

The workspace preparation logic (lines 200-229) is duplicated almost identically in both prepare_env and install_cozystack jobs. This violates the DRY principle and makes maintenance difficult.

Consider extracting the common workspace preparation steps into a reusable composite action or consolidating the logic. The duplication includes:

  • Sandbox ID generation
  • Workspace copying
  • Systemctl timer management
🧹 Nitpick comments (4)
.github/workflows/pull-requests.yaml (4)

65-66: Fix YAML formatting issues.

Static analysis detected formatting issues in the outputs section.

Apply this diff to fix the indentation and spacing:

    outputs:
-     installer_id: ${{ steps.fetch_assets.outputs.installer_id }}
-     disk_id:      ${{ steps.fetch_assets.outputs.disk_id }}
+      installer_id: ${{ steps.fetch_assets.outputs.installer_id }}
+      disk_id: ${{ steps.fetch_assets.outputs.disk_id }}

163-163: Remove trailing spaces.

Static analysis detected trailing spaces.

Apply this diff to remove trailing spaces:

-            --unit=rm-workspace-$SANDBOX_NAME \
+            --unit=rm-workspace-$SANDBOX_NAME \

198-198: Remove trailing spaces.

Static analysis detected trailing spaces.

Apply this diff to remove trailing spaces:

-        env:
+        env:

255-255: Fix comma spacing.

Static analysis detected missing space after comma.

Apply this diff to fix the spacing:

-    needs: [install_cozystack,detect_test_matrix]
+    needs: [install_cozystack, detect_test_matrix]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c5a302 and 4242973.

📒 Files selected for processing (7)
  • .github/workflows/pull-requests-release.yaml (1 hunks)
  • .github/workflows/pull-requests.yaml (3 hunks)
  • hack/e2e-apps.bats (0 hunks)
  • hack/e2e-apps/tenant.bats (0 hunks)
  • hack/e2e-cluster.bats (0 hunks)
  • hack/e2e-install-cozystack.bats (3 hunks)
  • packages/core/testing/Makefile (0 hunks)
💤 Files with no reviewable changes (4)
  • packages/core/testing/Makefile
  • hack/e2e-apps/tenant.bats
  • hack/e2e-apps.bats
  • hack/e2e-cluster.bats
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/pull-requests.yaml

[warning] 65-65: wrong indentation: expected 6 but found 5

(indentation)


[warning] 66-66: too many spaces after colon

(colons)


[error] 163-163: trailing spaces

(trailing-spaces)


[error] 198-198: trailing spaces

(trailing-spaces)


[warning] 255-255: too few spaces after comma

(commas)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build
🔇 Additional comments (11)
hack/e2e-install-cozystack.bats (3)

23-25: LGTM! Improved HelmRelease filtering.

The addition of the cozystack.io/system-app=true label filter appropriately narrows the scope to only wait for system applications, which is more precise than waiting for all HelmReleases.


45-49: LGTM! Added idempotent storage pool creation.

The logic to check for existing storage pools before creation prevents errors on test re-runs and makes the test more robust.


163-182: LGTM! Added tenant creation test coverage.

The new test appropriately covers tenant creation with isolated mode enabled, which aligns with the removal of more comprehensive tenant tests mentioned in the AI summary.

.github/workflows/pull-requests-release.yaml (3)

1-1: LGTM! Workflow name reflects its purpose.

The rename from "Releasing PR" to "Pull Request & Release" better describes the workflow's dual purpose.


5-5: LGTM! Appropriate trigger for release workflow.

Changing the trigger to only closed events is correct for a workflow that should only run when a PR is merged, not on every push.


9-9: LGTM! Consistent concurrency group naming.

The shortened concurrency group name pr- is consistent with the other workflow and more concise.

.github/workflows/pull-requests.yaml (5)

9-9: LGTM! Consistent concurrency group naming.

The shortened concurrency group name pr- is consistent with the release workflow and more concise.


60-117: LGTM! Well-structured asset resolution for release PRs.

The new resolve_assets job appropriately handles asset resolution for release PRs by:

  • Extracting tags from branch names with proper validation
  • Fetching draft release assets via GitHub API
  • Providing clear error messages for missing assets

119-168: LGTM! Unified environment preparation logic.

The refactored prepare_env job effectively consolidates environment setup with proper conditional logic for regular vs. release PRs.


236-248: LGTM! Dynamic test matrix generation.

The new detect_test_matrix job appropriately generates a dynamic test matrix by scanning for e2e test scripts, which is more maintainable than hardcoded matrices.


252-252: LGTM! Dynamic matrix usage.

The matrix now properly uses the dynamically generated output from detect_test_matrix, improving maintainability.

@kvaps
Andrei Kvapil (kvaps) force-pushed the refactor-workflows branch 2 times, most recently from 9a069de to 4f76706 Compare June 24, 2025 20:07

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/pull-requests.yaml (1)

149-169: Significant code duplication remains between jobs.

Despite the past review comment being marked as addressed, substantial duplication still exists between prepare_env and install_cozystack jobs, including:

  • Identical sandbox setup logic (lines 149-169 vs 202-231)
  • Similar workspace preparation steps
  • Duplicate systemctl cleanup commands

This violates DRY principles and increases maintenance burden.

Consider extracting the common sandbox setup logic into a reusable composite action or consolidating these jobs where possible. The duplication includes ~20 lines of identical workspace management code.

Also applies to: 202-231

🧹 Nitpick comments (3)
.github/workflows/pull-requests.yaml (3)

65-66: Fix YAML formatting issues.

The static analysis tools have identified formatting problems that should be corrected for consistency.

Apply this diff to fix the indentation and spacing issues:

-     installer_id: ${{ steps.fetch_assets.outputs.installer_id }}
-     disk_id:      ${{ steps.fetch_assets.outputs.disk_id }}
+      installer_id: ${{ steps.fetch_assets.outputs.installer_id }}
+      disk_id: ${{ steps.fetch_assets.outputs.disk_id }}

164-164: Remove trailing spaces.

Static analysis detected trailing spaces that should be removed for consistency.

Also applies to: 200-200


258-258: Fix spacing after comma.

Add a space after the comma for consistent formatting.

-    needs: [install_cozystack,detect_test_matrix]
+    needs: [install_cozystack, detect_test_matrix]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4242973 and 4f76706.

📒 Files selected for processing (7)
  • .github/workflows/pull-requests-release.yaml (1 hunks)
  • .github/workflows/pull-requests.yaml (4 hunks)
  • hack/e2e-apps.bats (0 hunks)
  • hack/e2e-apps/tenant.bats (0 hunks)
  • hack/e2e-cluster.bats (0 hunks)
  • hack/e2e-install-cozystack.bats (3 hunks)
  • packages/core/testing/Makefile (0 hunks)
💤 Files with no reviewable changes (4)
  • hack/e2e-apps/tenant.bats
  • packages/core/testing/Makefile
  • hack/e2e-apps.bats
  • hack/e2e-cluster.bats
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/pull-requests-release.yaml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/pull-requests.yaml

[warning] 65-65: wrong indentation: expected 6 but found 5

(indentation)


[warning] 66-66: too many spaces after colon

(colons)


[error] 164-164: trailing spaces

(trailing-spaces)


[error] 200-200: trailing spaces

(trailing-spaces)


[warning] 258-258: too few spaces after comma

(commas)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build
🔇 Additional comments (5)
hack/e2e-install-cozystack.bats (3)

23-25: Good optimization - filtering to system apps only.

The filtering logic using cozystack.io/system-app=true improves efficiency by focusing readiness checks only on system applications rather than all HelmReleases.


45-49: Smart addition - prevents duplicate storage pool creation.

The logic to check for existing "data" storage pools before creation prevents errors and makes the test idempotent, which is a best practice for e2e tests.


163-182: Good test coverage addition.

The new tenant creation test with isolated mode enabled adds valuable test coverage for tenant provisioning functionality. The test properly waits for both the HelmRelease and namespace to be ready.

.github/workflows/pull-requests.yaml (2)

60-117: Well-structured asset resolution for release PRs.

The new resolve_assets job properly handles tag extraction from release branches and fetches asset IDs from draft releases. The error handling and validation logic is appropriate.


238-250: Excellent dynamic test matrix approach.

The dynamic test matrix generation by scanning e2e app scripts is a significant improvement over static matrices, providing better maintainability and automatic discovery of new tests.

Comment thread .github/workflows/pull-requests.yaml

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/pull-requests.yaml (1)

161-164: Trailing whitespace – fails YAML-lint gating

Lines flagged by YAML-lint contain trailing spaces.
While harmless to the runner, the repo’s lint gate will fail; please strip them.

Also applies to: 195-200

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f76706 and 1b347b8.

📒 Files selected for processing (7)
  • .github/workflows/pull-requests-release.yaml (1 hunks)
  • .github/workflows/pull-requests.yaml (4 hunks)
  • hack/e2e-apps.bats (0 hunks)
  • hack/e2e-apps/tenant.bats (0 hunks)
  • hack/e2e-cluster.bats (0 hunks)
  • hack/e2e-install-cozystack.bats (3 hunks)
  • packages/core/testing/Makefile (0 hunks)
💤 Files with no reviewable changes (4)
  • packages/core/testing/Makefile
  • hack/e2e-apps/tenant.bats
  • hack/e2e-apps.bats
  • hack/e2e-cluster.bats
🚧 Files skipped from review as they are similar to previous changes (1)
  • hack/e2e-install-cozystack.bats
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/pull-requests.yaml

[warning] 65-65: wrong indentation: expected 6 but found 5

(indentation)


[warning] 66-66: too many spaces after colon

(colons)


[error] 164-164: trailing spaces

(trailing-spaces)


[error] 200-200: trailing spaces

(trailing-spaces)


[warning] 257-257: too few spaces after comma

(commas)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build
🔇 Additional comments (1)
.github/workflows/pull-requests-release.yaml (1)

20-22: Label-gated release trigger looks good

The additional merged == true && contains(label == 'release') guard is a clean way to ensure the job fires only for intentional release PRs.

Comment thread .github/workflows/pull-requests.yaml
Comment thread .github/workflows/pull-requests.yaml
Comment thread .github/workflows/pull-requests.yaml

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

♻️ Duplicate comments (2)
.github/workflows/pull-requests.yaml (2)

64-66: Incorrect indentation still breaks the outputs block
YAML-lint is flagging lines 65-66 (expected 6 but found 5).
GitHub will refuse to parse the workflow at run-time.

-    outputs:
-     installer_id: ${{ steps.fetch_assets.outputs.installer_id }}
-     disk_id:      ${{ steps.fetch_assets.outputs.disk_id }}
+    outputs:
+      installer_id: ${{ steps.fetch_assets.outputs.installer_id }}
+      disk_id:      ${{ steps.fetch_assets.outputs.disk_id }}

138-146: _out/assets directory missing before curl download (release PR path)
curl will fail because the parent directory does not exist when the job is running on a release PR (no artefact-download step precedes it).

-      - name: Download assets from draft release (release PR)
+      - name: Prepare _out/assets && download assets (release PR)
         if: contains(github.event.pull_request.labels.*.name, 'release')
         run: |
+          mkdir -p _out/assets
           curl -sSL -H "Authorization: token ${GH_PAT}" -H "Accept: application/octet-stream" \
             -o _out/assets/nocloud-amd64.raw.xz \
             "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/assets/${{ needs.resolve_assets.outputs.disk_id }}"
🧹 Nitpick comments (3)
.github/workflows/pull-requests.yaml (3)

70-78: Redundant step-level if: checks
The entire resolve_assets job already executes only when the PR has the release label (job.if). Repeating the same condition on every step is noise and invites desynchronisation. Remove the duplicate if: clauses to keep the workflow concise.


160-166: Trailing whitespace sneaked in
Lines 164 and 200 contain trailing spaces, which YAML-lint reports as errors. Please strip them to keep the workflow lint-clean.

Also applies to: 195-200


150-160: Workspace preparation duplicated across two jobs
prepare_env and install_cozystack repeat the same 30-line block for workspace copy & timer scheduling. Consider moving this into:

  1. A small bash script committed to the repo and invoked from both jobs, or
  2. A local reusable step (uses: ./.github/actions/prepare-workspace).

This will DRY the workflow and reduce maintenance burden.

Also applies to: 205-214

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b347b8 and 6c5f0f5.

📒 Files selected for processing (7)
  • .github/workflows/pull-requests-release.yaml (1 hunks)
  • .github/workflows/pull-requests.yaml (4 hunks)
  • hack/e2e-apps.bats (0 hunks)
  • hack/e2e-apps/tenant.bats (0 hunks)
  • hack/e2e-cluster.bats (0 hunks)
  • hack/e2e-install-cozystack.bats (3 hunks)
  • packages/core/testing/Makefile (0 hunks)
💤 Files with no reviewable changes (4)
  • packages/core/testing/Makefile
  • hack/e2e-apps/tenant.bats
  • hack/e2e-apps.bats
  • hack/e2e-cluster.bats
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/pull-requests-release.yaml
  • hack/e2e-install-cozystack.bats
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/pull-requests.yaml

[warning] 65-65: wrong indentation: expected 6 but found 5

(indentation)


[warning] 66-66: too many spaces after colon

(colons)


[error] 164-164: trailing spaces

(trailing-spaces)


[error] 200-200: trailing spaces

(trailing-spaces)


[warning] 257-257: too few spaces after comma

(commas)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build

@kvaps
Andrei Kvapil (kvaps) force-pushed the refactor-workflows branch 3 times, most recently from 64e722a to 56dc0e8 Compare June 24, 2025 21:38
Signed-off-by: Andrei Kvapil <[email protected]>

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

♻️ Duplicate comments (2)
.github/workflows/pull-requests.yaml (2)

64-66: Indentation under outputs breaks workflow parsing

installer_id / disk_id are indented 5 spaces instead of the required 6, so the
YAML is syntactically invalid and the workflow will be rejected at compile time.

-    outputs:
-     installer_id: ${{ steps.fetch_assets.outputs.installer_id }}
-     disk_id:      ${{ steps.fetch_assets.outputs.disk_id }}
+    outputs:
+      installer_id: ${{ steps.fetch_assets.outputs.installer_id }}
+      disk_id:      ${{ steps.fetch_assets.outputs.disk_id }}

138-146: _out/assets directory may not exist in release path

For release PRs the artefact-download step skips actions/download-artifact, so
the _out/assets directory is never created.
curl -o _out/assets/nocloud-amd64.raw.xz … will therefore fail.

Add an explicit mkdir before the curl:

-      - name: Download assets from draft release (release PR)
+      - name: Prepare _out/assets && download Talos image (release PR)
         if: contains(github.event.pull_request.labels.*.name, 'release')
-        run: |
-          curl -sSL -H "Authorization: token ${GH_PAT}" -H "Accept: application/octet-stream" \
-            -o _out/assets/nocloud-amd64.raw.xz \
-            "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/assets/${{ needs.resolve_assets.outputs.disk_id }}"
+        run: |
+          mkdir -p _out/assets
+          curl -sSL -H "Authorization: token ${GH_PAT}" -H "Accept: application/octet-stream" \
+            -o _out/assets/nocloud-amd64.raw.xz \
+            "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/assets/${{ needs.resolve_assets.outputs.disk_id }}"
🧹 Nitpick comments (4)
.github/workflows/pull-requests-release.yaml (1)

40-50: Update the tag command or the comment – they contradict each other

The comment says “create / push annotated tag” but the command uses
git tag -f … which produces a light-weight tag (no annotation).
Either add the -a flag (plus -m for the message) or adjust the comment.

- git tag -f ${{ steps.get_tag.outputs.tag }} ${{ github.sha }}
- git push -f origin ${{ steps.get_tag.outputs.tag }}
+ git tag -fa ${{ steps.get_tag.outputs.tag }} -m "Release ${{ steps.get_tag.outputs.tag }}" ${{ github.sha }}
+ git push -f origin ${{ steps.get_tag.outputs.tag }}
.github/workflows/pull-requests.yaml (3)

180-200: Trailing whitespace – GitHub rejects YAML with strict linters

Line 200 ends with stray spaces. Remove them to keep the file linter-clean.


210-223: Empty matrix ⇒ entire job skipped ⇒ pipeline marked as failed

If hack/e2e-apps contains no .bats files, apps becomes [].
An empty matrix causes “no jobs were found”, which GitHub treats as a
workflow error. Consider defaulting to a dummy value or gating the job.

Example guard:

  detect_test_matrix:
    …
    outputs:
      matrix: ${{ steps.set.outputs.matrix }}
      has_apps: ${{ steps.set.outputs.has_apps }}

# in the generating script
apps_json=$( … )
echo "matrix={\"app\":$apps_json}" >> "$GITHUB_OUTPUT"
echo "has_apps=$([[ $apps_json != \"[]\" ]])" >> "$GITHUB_OUTPUT"

# and in test_apps job
if: ${{ needs.detect_test_matrix.outputs.has_apps == 'true' }}

229-230: Minor style: add a space after the comma in the needs list

-    needs: [install_cozystack,detect_test_matrix]
+    needs: [install_cozystack, detect_test_matrix]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c5f0f5 and 56dc0e8.

📒 Files selected for processing (7)
  • .github/workflows/pull-requests-release.yaml (1 hunks)
  • .github/workflows/pull-requests.yaml (4 hunks)
  • hack/e2e-apps.bats (0 hunks)
  • hack/e2e-apps/tenant.bats (0 hunks)
  • hack/e2e-cluster.bats (0 hunks)
  • hack/e2e-install-cozystack.bats (3 hunks)
  • packages/core/testing/Makefile (1 hunks)
💤 Files with no reviewable changes (3)
  • hack/e2e-apps/tenant.bats
  • hack/e2e-apps.bats
  • hack/e2e-cluster.bats
🚧 Files skipped from review as they are similar to previous changes (2)
  • hack/e2e-install-cozystack.bats
  • packages/core/testing/Makefile
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/pull-requests.yaml

[warning] 65-65: wrong indentation: expected 6 but found 5

(indentation)


[warning] 66-66: too many spaces after colon

(colons)


[error] 200-200: trailing spaces

(trailing-spaces)


[warning] 229-229: too few spaces after comma

(commas)

@kvaps
Andrei Kvapil (kvaps) merged commit 9f9ca50 into main Jun 24, 2025
@kvaps
Andrei Kvapil (kvaps) deleted the refactor-workflows branch June 24, 2025 22:15
Andrei Kvapil (kvaps) added a commit that referenced this pull request Jun 24, 2025
Signed-off-by: Andrei Kvapil <[email protected]>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

- **New Features**
- Pull request workflows now support release pull requests by fetching
artifacts from draft releases and running all jobs without label-based
exclusions.
- Test matrices are now generated dynamically, improving flexibility in
end-to-end application testing.
- Added a new end-to-end test verifying tenant creation with isolated
mode enabled.

- **Refactor**
- Workflow steps and job dependencies have been streamlined for improved
efficiency and maintainability.
- Workflow names and concurrency group names have been updated for
clarity.
- Environment preparation and artifact handling have been unified into
consolidated jobs.
	- Release-related workflow simplified to a single finalize job.
- Makefile targets for asset copying and test execution have been
reorganized for better modularity.

- **Tests**
	- End-to-end application and cluster test scripts have been removed.
- Removed collective end-to-end test target; individual app test targets
remain.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Andrei Kvapil <[email protected]>
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