Skip to content

Conversation

@jerusdp
Copy link

@jerusdp jerusdp commented Sep 19, 2021

Objective

Periodically check the version of Rust in the latest docker container against the current Rust Stable channel version and create an issue if they do not match.

Components

The following components are added/changed:

* adds check.yml GitHub action

* amends Makefile

* adds latest.sh

* amends Dockerfile

check.yml

The GitHub Action action runs two jobs: check and create_issue. The action is scheduled to trigger each Tuesday morning at 0400Z. The action can also be triggered using a workflow_dispatch event.

check

Runs make check run the latest.sh script installed in the latest docker container.

create_issue

Runs if the check job fails to create an issue in the issue log.

Makefile

Adds a new task to run the latest docker container using the latest.sh as the entrypoint (instead of the default build.sh entrypoint).

latest.sh

Installs the Rust stable channel on the container.
Uses rustup check to extract the version number of the stable container.
Uses rustup show to extract the version number of the default toolchain (initially installed in the container).
Compares and exits with an error if they do not match.

Dockerfile

Adds latest.sh to the build

jerusdp and others added 30 commits September 13, 2021 07:14
Problem
Rust releases a new version approximatly every six weeks.
We need to detect a new release
Solution
* install the current stable toolchain
* extract the version of the stable toolchain from rustup check
* extract the version of the installed toolchain from rustup default
* compare and return an error if they do not match
Note
Docker containers are built with  a specific version (not stable).
Problem
Script to check must be installed in the build
Solution
* Add the latest.sh script to container
Note
Problem
Exceute the latest.sh script
Solution
* make command to run the latest.sh script entrypoint
Note
Problem
Version check should be executed routinely
Solution
* Use scheduled github action to run check
* Load unix and checkout source
* Make check to run script
Note
* docker on host will download latest conainer
FIX: missing colon on cron
FIX: yaml error
added checkout
checkout version2
FIX: ID created new step
Use different create issue action
Problem
Solution
Note
@zamazan4ik zamazan4ik self-requested a review September 29, 2021 23:20
Copy link

@zamazan4ik zamazan4ik left a comment

Choose a reason for hiding this comment

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

Nice work! I've thought about such automation in repo but didn't know that it's possible with GitHub Actions.

Please fix small cosmetic issues and I will merge this PR.

Sorry for delay - I didn't get a notification about this PR. Next time please explicitly request review from me - in this way I will definitely get a notification.

steps:
- run: gh issue create --title "Time to update to Rust" --body "Build update for next version of Rust" --label "enhancement" -R $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} No newline at end of file

Choose a reason for hiding this comment

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

Please add a newline

.gitignore Outdated
tests/test-*/test-out.log
target
.DS_Store
.vscode

Choose a reason for hiding this comment

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

Please add a newline

latest.sh Outdated

if [ "${STABLE}" == "${DEFAULT}" ]; then exit 0
else exit 1
fi No newline at end of file

Choose a reason for hiding this comment

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

Please add a newline

Makefile Outdated
check:
$(DOCKER) run --rm \
--entrypoint=/usr/local/bin/latest.sh \
$(REPO)

Choose a reason for hiding this comment

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

Please add a newline

@zamazan4ik zamazan4ik merged commit 764b9d1 into rust-serverless:master Sep 30, 2021
@jerusdp jerusdp deleted the latest branch September 30, 2021 15:10
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.

2 participants