Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: remove manage runs workflow #2325

Merged
merged 3 commits into from
Dec 4, 2024
Merged

ci: remove manage runs workflow #2325

merged 3 commits into from
Dec 4, 2024

Conversation

shumkov
Copy link
Member

@shumkov shumkov commented Nov 11, 2024

Issue being fixed or feature implemented

Manage PR workflow suppose to stop runs for closed PRs. This logic doesn't work well and flaky.
Debugging will take a lot of time. Since we switched to GitHub-hosted runners, running jobs for closed PRs it's not so big problem anymore.

What was done?

  • Removed manage workflow
  • Removed cached workflow
  • Added timeouts to all jobs so we won't have infinite runs

How Has This Been Tested?

None

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Copy link
Contributor

coderabbitai bot commented Nov 11, 2024

Walkthrough

The pull request involves the removal of several GitHub Actions workflow files, including .github/workflows/manage-runs.yml and .github/workflows/cached.yml. Additionally, it updates existing workflows by modifying timeout settings and adding new input parameters across various workflow files. These changes streamline the workflow management and enhance control over job execution times.

Changes

File Change Summary
.github/workflows/manage-runs.yml - Removed the workflow that managed runs for closed pull requests.
.github/workflows/cached.yml - Removed the workflow for rebuilding cached dependencies.
.github/workflows/prebuild-devcontainers.yml - Increased timeout-minutes from 60 to 240 for the build job.
.github/workflows/tests-build-image.yml - Added target input parameter to workflow_call.
- Set timeout-minutes to 30 for build-image job.
.github/workflows/tests-build-js.yml - Added timeout-minutes set to 10 for build-js job.
.github/workflows/tests-codeql.yml - Added timeout-minutes set to 15 for codeql job.
.github/workflows/tests-js-package.yml - Added timeout-minutes for lint (5) and test (15) jobs.
- Introduced skip-tests and test-command inputs.
.github/workflows/tests-rs-package.yml - Added new job detect_structure_changes with a timeout of 10 minutes.

Possibly related PRs

Suggested reviewers

  • QuantumExplorer
  • lklimek

Poem

🐇 In the land of code where workflows gleam,
We bid farewell to the manage runs dream.
With timeouts set and jobs refined,
Our CI's now clearer, perfectly aligned!
So hop along, dear friends, let’s cheer,
For smoother builds and code we hold dear! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
.github/workflows/manage-runs.yml (1)

Line range hint 35-48: Improve shell script robustness

The current shell script has potential issues with word splitting and globbing. Let's make it more robust.

Apply this diff to improve the shell script:

       - name: Cancel active workflow runs
         run: |
-          for id in ${WORKFLOW_IDS//,/ }
+          IFS=',' read -ra workflow_ids <<< "$WORKFLOW_IDS"
+          for id in "${workflow_ids[@]}"
           do
-            echo "Cancelling workflow with id: $id"
+            echo "Cancelling workflow with id: ${id}"

             # use curl here as I have no idea how to use a github action in a loop
             curl \
               -X POST \
               -H "Accept: application/vnd.github+json" \
               -H "Authorization: Bearer ${{ github.token }}" \
-              https://api.github.com/repos/${{ github.repository }}/actions/runs/$id/cancel
+              "https://api.github.com/repos/${{ github.repository }}/actions/runs/${id}/cancel"
           done
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 3b7ca92 and 201aa00.

📒 Files selected for processing (1)
  • .github/workflows/manage-runs.yml (2 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/manage-runs.yml

23-23: shellcheck reported issue in this script: SC2046:warning:11:21: Quote this to prevent word splitting

(shellcheck)


23-23: shellcheck reported issue in this script: SC2086:info:11:28: Double quote to prevent globbing and word splitting

(shellcheck)


23-23: shellcheck reported issue in this script: SC2086:info:11:58: Double quote to prevent globbing and word splitting

(shellcheck)


23-23: "github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details

(expression)

🔇 Additional comments (2)
.github/workflows/manage-runs.yml (2)

19-19: LGTM: Token usage follows best practices

The change to github.token aligns with GitHub's current best practices for accessing the default workflow token.


46-46: LGTM: Secure token usage in API call

The token is properly used in the Authorization header for the GitHub API call.

.github/workflows/manage-runs.yml Outdated Show resolved Hide resolved
@shumkov shumkov deleted the branch v1.7-dev November 29, 2024 10:09
@shumkov shumkov closed this Nov 29, 2024
@shumkov shumkov reopened this Nov 29, 2024
@shumkov shumkov changed the base branch from v1.6-dev to v1.7-dev November 29, 2024 10:30
@shumkov shumkov changed the title ci: fix run cancellation of closed PRs ci: remove manage runs workflow Dec 4, 2024
@shumkov shumkov self-assigned this Dec 4, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
.github/workflows/tests-build-js.yml (1)

Line range hint 17-17: Track the TODO as a separate issue

The comment indicates a planned migration from cache to upload artifacts action.

Would you like me to create a GitHub issue to track this TODO item for replacing the caching step with upload artifacts action?

.github/workflows/tests-rs-package.yml (2)

Line range hint 129-133: Track the FIXME as a separate issue

The comment indicates a limitation with PR-only execution of structure detection.

Would you like me to create a GitHub issue to track implementing support for manual triggers in the structure detection job?


Line range hint 144-190: Enhance error messages in structure detection script

The structure detection implementation is solid, but the error messages could be more descriptive.

Consider enhancing the error messages to include more context:

-                echo "Deletions detected in @append_only structures in $file. Test failed."
+                echo "ERROR: Deletions detected in @append_only structures in $file. This violates the append-only constraint."
-                echo "Code changes detected in @immutable structures in $file. Test failed."
+                echo "ERROR: Code changes detected in @immutable structures in $file. This violates the immutability constraint."
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 201aa00 and 119d5a4.

📒 Files selected for processing (8)
  • .github/workflows/cached.yml (0 hunks)
  • .github/workflows/manage-runs.yml (0 hunks)
  • .github/workflows/prebuild-devcontainers.yml (1 hunks)
  • .github/workflows/tests-build-image.yml (1 hunks)
  • .github/workflows/tests-build-js.yml (1 hunks)
  • .github/workflows/tests-codeql.yml (1 hunks)
  • .github/workflows/tests-js-package.yml (2 hunks)
  • .github/workflows/tests-rs-package.yml (1 hunks)
💤 Files with no reviewable changes (2)
  • .github/workflows/manage-runs.yml
  • .github/workflows/cached.yml
🔇 Additional comments (10)
.github/workflows/prebuild-devcontainers.yml (1)

22-22: Timeout increase is appropriate for multi-arch container builds.

The increase to 240 minutes is reasonable given this job builds containers for both amd64 and arm64 architectures.

Let's verify the historical build times to confirm this timeout is appropriate:

.github/workflows/tests-codeql.yml (1)

8-8: Verify CodeQL analysis typically completes within 15 minutes.

While 15 minutes is generally sufficient for JavaScript CodeQL analysis, we should verify this against historical run times.

Let's check recent CodeQL job durations:

.github/workflows/tests-build-image.yml (3)

Line range hint 9-12: Good addition of the target parameter.

Adding the required target parameter improves workflow flexibility and aligns with multi-stage Docker build best practices.


Line range hint 1-1: Verify complete removal of manage-runs workflow.

While the timeout additions are good improvements, let's verify the primary PR objective of removing the manage-runs workflow.

Let's confirm the workflow removal:

✅ Verification successful

Workflow removal confirmed - no remaining references found

The verification confirms that:

  • The manage-runs.yml workflow file has been completely removed
  • No remaining references to "manage-runs" exist in any workflow files
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify manage-runs workflow is removed
if [ -f .github/workflows/manage-runs.yml ]; then
    echo "Warning: manage-runs.yml still exists"
else
    echo "Confirmed: manage-runs.yml has been removed"
fi

# Check for any remaining references to the removed workflow
rg -l "manage-runs" .github/workflows/

Length of output: 182


21-21: Verify build time constraints for Docker images.

The 30-minute timeout should be sufficient for most Docker builds, but let's verify against historical data.

Let's check recent build durations:

.github/workflows/tests-build-js.yml (1)

8-8: LGTM: Reasonable timeout for JS build job

The 10-minute timeout is appropriate for a JS build job and aligns with timeouts in other workflows.

.github/workflows/tests-js-package.yml (3)

21-21: LGTM: Appropriate timeout for lint job

5-minute timeout is suitable for linting tasks.


56-56: LGTM: Reasonable timeout for test job

15-minute timeout is appropriate for test execution.


Line range hint 7-13: LGTM: Well-structured workflow inputs

The new inputs enhance workflow flexibility:

  • skip-tests: Allows conditional test execution
  • test-command: Enables customizable test commands
.github/workflows/tests-rs-package.yml (1)

127-127: LGTM: Appropriate timeout for structure detection

10-minute timeout is suitable for the structure detection job.

@shumkov shumkov merged commit 5c9b3fc into v1.7-dev Dec 4, 2024
130 checks passed
@shumkov shumkov deleted the ci/manage-runs branch December 4, 2024 07:28
@thephez thephez added this to the v1.7.0 milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants