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(label): skip duplicated build on PR creation #3155

Merged
merged 27 commits into from
Aug 26, 2023
Merged

Conversation

clearloop
Copy link
Contributor

@clearloop clearloop commented Aug 22, 2023

Resolves #3148
Resolves #3142

  • ( after label checks ) process build only if the previous build is skipped
  • mark the name of the triggered builds
  • more details of the shadow build
  • workaorund for Replace log::error! with log::trace! #3154
  • introduce timeout for checks

Tests

show case of skipping duplicated build: https://github.com/clearloop/gear/pull/2
show case of named builds: https://github.com/gear-tech/gear/actions/runs/5943456240/job/16118640453

@gear-tech/dev

@clearloop clearloop added A0-pleasereview PR is ready to be reviewed by the team and removed A0-pleasereview PR is ready to be reviewed by the team labels Aug 22, 2023
@clearloop clearloop added the A0-pleasereview PR is ready to be reviewed by the team label Aug 22, 2023
@clearloop clearloop marked this pull request as ready for review August 22, 2023 19:21
@clearloop clearloop removed the A0-pleasereview PR is ready to be reviewed by the team label Aug 22, 2023
@clearloop clearloop added the A0-pleasereview PR is ready to be reviewed by the team label Aug 22, 2023
@clearloop clearloop marked this pull request as draft August 22, 2023 19:33
@clearloop clearloop removed the A0-pleasereview PR is ready to be reviewed by the team label Aug 22, 2023
@clearloop clearloop added A0-pleasereview PR is ready to be reviewed by the team and removed A0-pleasereview PR is ready to be reviewed by the team labels Aug 22, 2023
@clearloop clearloop added the A0-pleasereview PR is ready to be reviewed by the team label Aug 22, 2023
@clearloop clearloop marked this pull request as ready for review August 22, 2023 20:01
.github/actions/label/build.js Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
@shamilsan
Copy link
Contributor

Need to add A4-insubstantial to CI triggers too.

@clearloop clearloop added A0-pleasereview PR is ready to be reviewed by the team and removed A0-pleasereview PR is ready to be reviewed by the team A4-insubstantial Not too important PR labels Aug 23, 2023
@clearloop clearloop added A4-insubstantial Not too important PR and removed A0-pleasereview PR is ready to be reviewed by the team labels Aug 23, 2023
@clearloop clearloop added A2-mergeoncegreen PR is ready to merge after CI passes and removed A4-insubstantial Not too important PR labels Aug 23, 2023
@clearloop clearloop removed the A5-dontmerge PR should not be merged yet label Aug 23, 2023
@clearloop
Copy link
Contributor Author

@CodiumAI-Agent /review

@CodiumAI-Agent
Copy link

PR Analysis

  • 🎯 Main theme: Improving the CI/CD pipeline by skipping duplicated builds and introducing timeouts for checks.
  • 📌 Type of PR: Enhancement
  • Focused PR: Yes, all changes are related to improving the CI/CD pipeline.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • General suggestions: The PR seems to be well-structured and focused on improving the CI/CD pipeline. However, it would be beneficial to add tests to ensure the new changes work as expected. Also, consider adding error handling for unexpected cases to make the code more robust.

  • 🤖 Code feedback:

    • relevant file: .github/actions/label/build.js
      suggestion: Consider adding error handling for the asynchronous operations. This can help to catch and handle any potential errors that might occur during the execution of these operations. [important]
      relevant line: "const { data: { check_runs }, } = await github.rest.checks.listForRef({ owner, repo, ref: REF, });"

    • relevant file: .github/actions/label/build.js
      suggestion: It would be beneficial to add comments explaining the logic behind the 'skip' function. This can help other developers understand the code more easily. [medium]
      relevant line: "const skip = async ({ core, github }) => {"

    • relevant file: .github/actions/label/build.js
      suggestion: Consider using more descriptive variable names. For example, 'linux' could be renamed to something like 'isLinuxLabel'. This can make the code more readable. [medium]
      relevant line: "const linux = LABEL === 'A0-pleasereview' || LABEL === 'A4-insubstantial' || LABEL === 'A2-mergeoncegreen';"

How to use

Tag me in a comment '@CodiumAI-Agent' and add one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

@clearloop clearloop removed the A2-mergeoncegreen PR is ready to merge after CI passes label Aug 24, 2023
@clearloop clearloop added the A0-pleasereview PR is ready to be reviewed by the team label Aug 24, 2023
@clearloop
Copy link
Contributor Author

now 12:11, waiting for 2 hrs see if the timeout logic still has bug xd

@clearloop clearloop added the A5-dontmerge PR should not be merged yet label Aug 24, 2023
@clearloop clearloop removed the A0-pleasereview PR is ready to be reviewed by the team label Aug 24, 2023
@clearloop clearloop added the A2-mergeoncegreen PR is ready to merge after CI passes label Aug 24, 2023
@clearloop
Copy link
Contributor Author

f687051 requires rerun implementation #3088

@clearloop clearloop merged commit 2159036 into master Aug 26, 2023
8 checks passed
@clearloop clearloop deleted the cl/issue-3148-2 branch August 26, 2023 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A2-mergeoncegreen PR is ready to merge after CI passes A5-dontmerge PR should not be merged yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skip processing build if PR created with A0-pleaseview Provide more info in Label/dispatch
5 participants