Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Move cargo fmt checks and some other jobs to stable, ubuntu-latest #2450

Merged
merged 4 commits into from
Aug 29, 2020

Conversation

Veetaha
Copy link
Contributor

@Veetaha Veetaha commented Aug 21, 2020

Description

See #2443 (comment)

Modifications

  • Now a bunch of jobs that were previously selected to be run on macos switched to ubuntu-latest, cargo fmt check is one of them

PR Checklist

By placing an x in the boxes I certify that I have:

  • Added unit tests for new code added in this PR.
  • Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.
  • Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
  • Updated the content of the book if this PR would make the book outdated.

If this modified or created any rs files:

  • Ran cargo +stable fmt --all
  • Ran cargo clippy --workspace --features "empty" (may require cargo clean before)
  • Ran cargo build --features "empty"
  • Ran cargo test --workspace --features "empty"

Copy link
Member

@CleanCut CleanCut left a comment

Choose a reason for hiding this comment

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

Caught a couple things you missed on the mdbook-linkcheck section. I know it's commented out, but let's keep it in good shape for when we uncomment it (hopefully really soon!). 😄

I find the runtimes of this CI run fascinating.

  • macos stable - 17m
  • macos beta - 14m
  • macos nightly - 51m

The speed of first two means we got assigned to the fast macOS runners (the newer, slower ones take 20+ minutes).

The slowness of the last one is the sporadic macOS CI bug that hasn't been eliminated from the shared workers. AFAICT the bug affects both the fast and slow runners.

  • ubuntu stable - 22m
  • ubuntu beta - 18m
  • ubuntu nightly - 18m

In my initial testing, there were only the faster mac runners, so I was comparing the ~18m Linux runtime against ~14m macOS runs. Given the current situation, Linux is a better choice.


# Should be working, but postponing until after we go live with GitHub Actions
# - name: install mdbook-linkcheck on stable macos
# - name: install mdbook-linkcheck on stable, ubuntu-latest
# run: |
# curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.7.0/mdbook-linkcheck-v0.7.0-x86_64-apple-darwin.tar.gz | tar -xz && mv mdbook-linkcheck /Users/runner/.cargo/bin/mdbook-linkcheck
Copy link
Member

Choose a reason for hiding this comment

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

  • The URL for the mdbook binary needs to be changed to the Linux one.
  • The location for the untarred binary needs to be changed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 213d343


# Should be working, but postponing until after we go live with GitHub Actions
# - name: install mdbook-linkcheck on stable macos
# - name: install mdbook-linkcheck on stable, ubuntu-latest
# run: |
# curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.7.0/mdbook-linkcheck-v0.7.0-x86_64-apple-darwin.tar.gz | tar -xz && mv mdbook-linkcheck /Users/runner/.cargo/bin/mdbook-linkcheck
# chmod a+x /Users/runner/.cargo/bin/mdbook-linkcheck
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be updated to the new location of the binary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 213d343

- name: run tests
run: |
cargo test --workspace --features=${{matrix.FEATURES}}
- run: cargo test --workspace --features=${{matrix.FEATURES}}
Copy link
Member

Choose a reason for hiding this comment

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

I prefer the concise, descriptive names, but I am willing to approve the PR without them.

Copy link
Contributor Author

@Veetaha Veetaha Aug 25, 2020

Choose a reason for hiding this comment

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

As for me, a simple cargo foo invocation looks descriptive enough by itself...

@Veetaha
Copy link
Contributor Author

Veetaha commented Aug 25, 2020

I've verified that linkcheck works in this commit 213d343 in this ci run: https://github.com/amethyst/amethyst/pull/2450/checks?check_run_id=1028251375#step:13:11

@Veetaha Veetaha requested a review from CleanCut August 25, 2020 19:58
@Veetaha Veetaha force-pushed the feat/run-jobs-on-ubuntu-latest branch from 231e117 to 08106e7 Compare August 25, 2020 20:15
@Veetaha Veetaha force-pushed the feat/run-jobs-on-ubuntu-latest branch from 08106e7 to 5b3410e Compare August 25, 2020 20:16
@Blisto91
Copy link
Contributor

I'm currently working on fixing all the broken links and linkcheck warnings.
Will also prepare the options in book.toml 👍

@CleanCut
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Aug 27, 2020
2450: Move cargo fmt checks and some other jobs to stable, ubuntu-latest r=CleanCut a=Veetaha

## Description

See #2443 (comment)

## Modifications

- Now a bunch of jobs that were previously selected to be run on `macos` switched to `ubuntu-latest`, cargo fmt check is one of them

## PR Checklist

By placing an x in the boxes I certify that I have:

- [ ] Added unit tests for new code added in this PR.
- [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.
- [ ] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
- [ ] Updated the content of the book if this PR would make the book outdated.

If this modified or created any rs files:

- [ ] Ran `cargo +stable fmt --all`
- [ ] Ran `cargo clippy --workspace --features "empty"` (may require `cargo clean` before)
- [ ] Ran `cargo build --features "empty"`
- [ ] Ran `cargo test --workspace --features "empty"`


Co-authored-by: Veetaha <veetaha2@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 27, 2020

Build failed:

@Veetaha
Copy link
Contributor Author

Veetaha commented Aug 27, 2020

Whoops, what could go wrong...

@Veetaha
Copy link
Contributor Author

Veetaha commented Aug 28, 2020

Hmm, I can't reproduce the clippy warning locally...

@Blisto91
Copy link
Contributor

Looks like it started with the newly released rust version.
But I didn't see it mentioned in the clippy changelog

@Veetaha
Copy link
Contributor Author

Veetaha commented Aug 28, 2020

This could be some bug fix in 1.46
I guess it might make sense to pin the stable version, or run clippy at least for the beta toolchain or don't deny warnings on ci

@Blisto91
Copy link
Contributor

I'm not a fan of preventing the CI from updating to the latest stable as soon as it's released. If thats what you mean by pin the stable version.
A minor semver version of rust is only released approx. every 6 weeks so i don't think it's too much of a bother if something breaks.
If we also enable clippy lints on beta we might risk that things break more often when bugs are introduced or false positivs comes up for a short time.

@Veetaha
Copy link
Contributor Author

Veetaha commented Aug 28, 2020

I'm not a fan of preventing the CI from updating to the latest stable as soon as it's released. If thats what you mean by pin the stable version.
A minor semver version of rust is only released approx. every 6 weeks so I don't think it's too much of a bother if something breaks.
If we also enable clippy lints on beta we might risk that things break more often when bugs are introduced or false positivs comes up for a short time.

Since clippy may introduce new warnings to code that was ok on the previous minor toolchain version and
taking into account @Blisto91 feedback I see these options:

  • We accept that each 6 weeks our ci may be failing due to new clippy lints and fix them ASAP
    This means unrelated PRs will be blocked until the fix.
  • We make clippy a separate job and make it optional to pass via continue-on-error. This will protect us from sudden breakages, though also allow merging the branch with clippy warnings, but the job should be displayed with a red cross so it's easy to notice that clippy is failing, anyway
  • We do remove --deny warnings. This means the warnings will most likely be ignored if some person doesn't regularly keep an eye on them.

Regarding the beta/nightly runs
I would also make them optional via continue-on-error. In my experience we had a number of times the bugs were introduced to nightly toolchain so that our nightly job was failing. The purpose of running such jobs is to verify our code forwards compatibility with the toolchain updates and to give rust core team some feedback in case of regressions too.

@Blisto91
Copy link
Contributor

Blisto91 commented Aug 29, 2020

The resistance we had to continue-on-error originally was because we didn't like how it was presented in the ui with the red crosses.
We were looking for alternatives but there aren't any that are properly supported by github.
But I can see that there are scenarios where it can make sense to use it.

I think the short to mid term aim should be to make life easier for the project with minimal manual maintenance (without compromising too much on quality). Currently the activity and reaction pace can be at bit slow so I would like to minimize scenarios where something has to be fixed quickly to rid errors popping up everywhere.
In the clippy case I'm personally leaning towards removing --deny warnings

@Veetaha Veetaha mentioned this pull request Aug 29, 2020
8 tasks
bors bot pushed a commit that referenced this pull request Aug 29, 2020
2468: Fix clippy, don't deny warnings r=Blisto91 a=Veetaha


## Description

Fixed the new warnings introduced in 1.46.0 update.
Also had to remove `--deny warnings` as discussed: #2450 (comment)

## PR Checklist

By placing an x in the boxes I certify that I have:

- [ ] Added unit tests for new code added in this PR.
- [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.
- [ ] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
- [ ] Updated the content of the book if this PR would make the book outdated.

If this modified or created any rs files:

- [ ] Ran `cargo +stable fmt --all`
- [ ] Ran `cargo clippy --workspace --features "empty"` (may require `cargo clean` before)
- [ ] Ran `cargo build --features "empty"`
- [ ] Ran `cargo test --workspace --features "empty"`


Co-authored-by: Veetaha <veetaha2@gmail.com>
@Veetaha
Copy link
Contributor Author

Veetaha commented Aug 29, 2020

@CleanCut , @Blisto91 I think this is ready for bors r+ to retry

@Blisto91
Copy link
Contributor

bors r+

@bors bors bot merged commit c8c01b0 into amethyst:master Aug 29, 2020
@ezpuzz ezpuzz added the type: maintenance A task that has no noticeable user-facing effect. Code cleanup, small refactors, etc. label Jan 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: maintenance A task that has no noticeable user-facing effect. Code cleanup, small refactors, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants