Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[CI] Companion labels redux #8627

Closed
wants to merge 5 commits into from
Closed

[CI] Companion labels redux #8627

wants to merge 5 commits into from

Conversation

s3krit
Copy link
Contributor

@s3krit s3krit commented Apr 15, 2021

Previously, we had a Github Action that would continuously monitor the status of the check_polkadot_companion_build job against a PR and label it depending on the outcome of that job. This PR just moves that logic into the check_polkadot_companion_build itself. This'll hopefully do some work to reduce the amount of Github API calls we use, thus hopefully avoid issues such as this.

While I was there, I also neatened up how we consume the GITHUB_TOKEN in lib.sh and fixed some shellcheck nags.

Fixes paritytech/ci_cd#125

EDIT: Realised why this was a Github Action in the first place... Gitlab CI jobs running on PRs aren't protected branches (obviously), so don't have access to a Github token capable of updating labels on PRs. It's a bit shit and unless I come up with something to work around this, we're essentially stuck.

@s3krit s3krit added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Apr 15, 2021
@s3krit s3krit requested review from gabreal, TriplEight and a team April 15, 2021 17:02
@s3krit s3krit marked this pull request as draft April 16, 2021 12:38
@s3krit s3krit marked this pull request as ready for review April 16, 2021 13:57
@s3krit s3krit marked this pull request as draft April 16, 2021 14:52
@s3krit s3krit added A3-in_progress Pull request is in progress. No review needed at this stage. and removed A0-please_review Pull request needs code review. labels Apr 16, 2021
# in Github or Gitlab CI
github_token() {
# These will exist if the function is called in Gitlab.
# If the function's called in Github, we should have GITHUB_ACCESS_TOKEN set
Copy link
Contributor

Choose a reason for hiding this comment

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

will this token then be used by the curl calls? otherwise setting it from another else block would help.

remove_label 'paritytech/substrate' "${CI_COMMIT_REF_NAME}" 'A7-needspolkadotpr'
exit 0
else
add_label 'paritytech/substrate' "${CI_COMMIT_REF_NAME}" 'A7-needspolkadotpr'
Copy link
Contributor

Choose a reason for hiding this comment

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

how about the error handling here if this is running from a pr? i used to use a helper job for this like here: https://gitlab.parity.io/parity/infrastructure/github-api/-/blob/master/.gitlab-ci.yml

@stale
Copy link

stale bot commented Jul 7, 2021

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 7, 2021
@s3krit s3krit closed this Jul 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-in_progress Pull request is in progress. No review needed at this stage. A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants