-
Notifications
You must be signed in to change notification settings - Fork 0
feat: new update-ui command #37
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "$schema": "../../node_modules/command-bot/src/schema/schema.cmd.json", | ||
| "command": { | ||
| "description": "Update UI tests, e.g. after a rust toolchain upgrade, and commit them to your PR.", | ||
| "configuration": { | ||
| "gitlab": { | ||
| "job": { | ||
| "tags": ["linux-docker-vm-c2"], | ||
| "variables": {} | ||
| } | ||
| } | ||
| }, | ||
| "presets": { | ||
| "substrate": { | ||
| "description": "Update substrate UI tests", | ||
| "repos": ["substrate"], | ||
| "args": { | ||
| "rust_version": { "label": "Rust version", "type_rule": "/^[0-9.]+$/", "example": "1.70" } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eu -o pipefail | ||
| shopt -s inherit_errexit | ||
|
|
||
| . "$(dirname "${BASH_SOURCE[0]}")/../utils.sh" | ||
| . "$(dirname "${BASH_SOURCE[0]}")/../cmd_runner.sh" | ||
|
|
||
| main() { | ||
| # setup. | ||
| cmd_runner_setup | ||
|
|
||
| rust_version="$1" | ||
| if [[ -z "${rust_version}" ]]; then | ||
| die "missing rust version argument" | ||
| fi | ||
|
|
||
| # This script uses rustup to install the required rust version. | ||
| # Doing that in CI feels rather ugly, but sadly there's currently no mechanism | ||
| # in command-bot to use a different CI image for individual jobs, so this is | ||
| # the best we can do. | ||
| .maintain/update-rust-stable.sh "${rust_version}" | ||
|
|
||
| # commit. | ||
| git add . | ||
| git commit -m "${COMMIT_MESSAGE}" | ||
|
|
||
| # Push the results to the target branch | ||
| git remote add \ | ||
| github \ | ||
| "https://token:${GITHUB_TOKEN}@github.com/${GH_CONTRIBUTOR}/${GH_CONTRIBUTOR_REPO}.git" | ||
| git push github "HEAD:${GH_CONTRIBUTOR_BRANCH}" | ||
| } | ||
|
|
||
| main "$@" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds like a nice feature to have.
@mordamax currently we're using paritytech/ci-linux:production, as far as I understand.
But does anything stop us from allowing that to be configured in the command scripts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry may be i don't get this question
isn't setting
tagin .cmd.jsonlinux-docker-vm-c2to something else lets to change the image?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it changes the machine to execute the job on, not the image...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea while i thought different machine would have different image
but yea, you're right, now i paid attention that we have this configured on the app level
yea, technically abs possible to make it as part of .cmd.json, but would that be ok overall? i mean secure etc
cc @altaua @alvicsam
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that'd be useful, and no particular security concern. (For example, the CI image for normal CI jobs is configured in the .gitlab-ci.yml of the repo being tested; being able to configure it here in
command-bot-scriptsis no worse than that.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea i can add it then to a .cmd.json config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paritytech/command-bot#211