Skip to content

Code refactor #152

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 34 commits into from
May 5, 2022
Merged

Code refactor #152

merged 34 commits into from
May 5, 2022

Conversation

kraktus
Copy link
Contributor

@kraktus kraktus commented May 4, 2022

No functional changes

As posted on zulip this part of a larger effort to modernise the code of the project, but for the code review to be easier thought it would be better to split it in parts. The PR contains quite a few commits compared to the changes but each of those is a logic unit that pass the tests and with formatted code.

@kraktus kraktus marked this pull request as draft May 4, 2022 13:41
kraktus added 3 commits May 4, 2022 16:05
Before we stored `Datetime` and `Date` altogether when our scale is the number of days

Also test new date parser `GithubCommitElem::date`
`Result<T,E>` is preferred over enums as it allows to use the `?` operator, at least until `trait_v2` is stabilised if ever.
@kraktus kraktus marked this pull request as ready for review May 4, 2022 14:19
Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

just one question that wasn't clear to me from the documentation of clap/structop

Comment on lines -97 to 90
#[structopt(
long = "preserve-target",
help = "Preserve the target directory used for builds"
)]
#[structopt(long, help = "Preserve the target directory used for builds")]
preserve_target: bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

are underscores converted to dashes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it does, -h after the changes

cargo-bisect-rustc 0.6.3

USAGE:
    cargo-bisect-rustc [FLAGS] [OPTIONS] [-- <command-args>...]

FLAGS:
    -a, --alt                Download the alt build instead of normal build
        --by-commit          Bisect via commit artifacts
        --force-install      Force installation over existing artifacts
    -h, --help               Prints help information
        --preserve           Preserve the downloaded artifacts
        --preserve-target    Preserve the target directory used for builds
        --prompt             Manually evaluate for regression with prompts
    -V, --version            Prints version information
        --verbose            
        --with-dev           Download rustc-dev [default: no download]
        --with-src           Download rust-src [default: no download]
        --without-cargo      Do not install cargo [default: install cargo]

OPTIONS:
        --access <access>              How to access Rust git repository [github|checkout]
    -c, --component <components>...    additional components to install
        --end <end>                    Right bound for search (*with* regression). You can use a date (YYYY-MM-DD), git
                                       tag name (e.g. 1.58.0) or git commit SHA.
        --host <host>                  Host triple for the compiler [default: unknown]
        --install <install>            Install the given artifact
        --regress <regress>            Custom regression definition [default: error]
        --script <script>              Script replacement for `cargo build` command
        --start <start>                Left bound for search (*without* regression). You can use a date (YYYY-MM-DD),
                                       git tag name (e.g. 1.58.0) or git commit SHA.
        --target <target>              Cross-compilation target platform
        --test-dir <test-dir>          Root directory for tests [default: .]
    -t, --timeout <timeout>            Assume failure after specified number of seconds (for bisecting hangs)

ARGS:
    <command-args>...    Arguments to pass to cargo or the file specified by --script during tests

EXAMPLES:
    Run a fully automatic nightly bisect doing `cargo check`:
    ```
    cargo bisect-rustc --start 2018-07-07 --end 2018-07-30 --test-dir ../my_project/ -- check
    ```

    Run a PR-based bisect with manual prompts after each run doing `cargo build`:
    ```
    cargo bisect-rustc --start 6a1c0637ce44aeea6c60527f4c0e7fb33f2bcd0d \
      --end 866a713258915e6cbb212d135f751a6a8c9e1c0a --test-dir ../my_project/ --prompt -- build
    ```

@oli-obk oli-obk merged commit 1d6cfb7 into rust-lang:master May 5, 2022
@oli-obk
Copy link
Contributor

oli-obk commented May 5, 2022

this is an awesome cleanup! thank you

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants