Guardian Self Assessment CLI tool

Overview

Guardian Self Assessment CLI tool

What?

self-assessment is a tool that generates a list of PRs authored and reviewed by you.

Why?

Assessing oneself is hard - this tool aims to make the process a little bit easier.
It is not meant to be the be-all and end-all of the self-assessment journey. Use it as a starting point to remember your contributions to the Guardian.

Usage

  1. You need Rust to install self-assessment. Running the following command will install the Rust toolchain on your machine. If Rust is already installed, skip this step.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Run cargo install self-assessment to install the CLI tool.

  2. You can now use the CLI tool! But first, you need to generate a GitHub personal access token 👉 here 👈
    Set your preferred expiration date and make sure you grant the repo scopes (avoid "No expiration" for security reasons). Finally, click "Generate token".
    NB: You will need to re-authenticate once the token expires.

image

  1. Set the access token by running the following command (replace with the generated token):
self-assessment --auth-token <AUTH_TOKEN>
  1. You can now run the CLI tool using the following syntax:
self-assessment --from <YYYY-MM-DD> --to <YYYY-MM-DD>

Both the --from and --to flags are optional.
If no flags are specified (i.e. if you just execute self-assessment), you will get a list of all PRs with no time constraints. This is not recommended, as it is likely to incur GitHub's secondary rate limit (particularly if you've been at the Guardian a long time and are a prolific contributor). Omitting one of the two flags also works (e.g self-assessment --from 2021-10-01).

If all goes well, you should see an automatically generated HTML page containing useful information about PRs authored and reviewed by you.

image

image

CLI information

self-assessment 0.1.0

USAGE:
    self-assessment [OPTIONS]

OPTIONS:
    -a, --auth-token 
   
        Github authentication token. This is needed to run the CLI
                                     tool. You can get a personal access token at
                                     https://github.com/settings/tokens/new [default: ]
    -f, --from 
    
                     Match PRs that were created after this date [default: *]
    -h, --help                       Print help information
    -t, --to 
     
                          Match PRs that were created up until this date [default: *]
    -V, --version                    Print version information

     
    
   
Comments
  • Bump regex from 1.5.4 to 1.5.6

    Bump regex from 1.5.4 to 1.5.6

    Bumps regex from 1.5.4 to 1.5.6.

    Changelog

    Sourced from regex's changelog.

    1.5.6 (2022-05-20)

    This release includes a few bug fixes, including a bug that produced incorrect matches when a non-greedy ? operator was used.

    1.5.5 (2022-03-08)

    This releases fixes a security bug in the regex compiler. This bug permits a vector for a denial-of-service attack in cases where the regex being compiled is untrusted. There are no known problems where the regex is itself trusted, including in cases of untrusted haystacks.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • v2.0.0

    v2.0.0

    [2.0.0] - 2022-11-12

    Changed

    • Usage of the CLI has changed - you can now use the following subcommands:
      • self-assessment auth <TOKEN> to provide the Github authentication token.
      • self-assessment trello-auth <API_KEY> <TOKEN> to provide the Trello Api key and server token.
      • self-assessment generate-report [--from <YYYY-MM-DD>] [--to <YYYY-MM-DD>] [--skip-trello] to generate a report. The flags in square brackets are optional.

    Fixed

    • Fixed an issue that caused empty Github milestones to exit the CLI execution with an error. Closes #13
    opened by marsavar 0
  • Failed to parse JSON

    Failed to parse JSON

    After running self-assessment --from 2022-01-01 --to 2022-06-30 I do get this error.

    [self-assessment] 🔎 Collecting pull requests authored by you...
    JSON Error in items[11].milestone.description: invalid type: null, expected a string at line 1 column 62678
    Found at  0 backtrace::backtrace::trace::h33480716c27414dc
     1 backtrace::capture::Backtrace::new::h001d30940d867262
     2 <octocrab::error::JsonSnafu as snafu::IntoError<octocrab::error::Error>>::into_error::hca00a15918be955f
     3 <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hd6fcbbecced7949b
     4 <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h571510801238bd71
     5 self_assessment::main::{{closure}}::h84156e9222efbf61
     6 std::thread::local::LocalKey<T>::with::hefa3ce91d9a48909
     7 tokio::park::thread::CachedParkThread::block_on::h881cd05d9825d10f
     8 tokio::runtime::thread_pool::ThreadPool::block_on::h2788a4243359ffc6
     9 tokio::runtime::Runtime::block_on::h9bf7b1f6e68aef8c
    10 self_assessment::main::h34e546d59fb462b9
    11 std::sys_common::backtrace::__rust_begin_short_backtrace::h25022e68c234c92a
    12 std::rt::lang_start::{{closure}}::hf0c6b1186fcbcff2
    13 core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hfc87a1b486ea6796
       /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/ops/function.rs:280
       std::panicking::try::do_call::h7dcb1e4efbfac5dc
       /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:492
       std::panicking::try::h4ee76056fd63c1cd
       /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:456
       std::panic::catch_unwind::hbd5e8ad01dd6a9ee
       /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panic.rs:137
       std::rt::lang_start_internal::{{closure}}::h67dd3aa83aa43833
       /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:128
       std::panicking::try::do_call::h5c2aca003eb2a1cb
       /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:492
       std::panicking::try::h22495619ddde9ed3
       /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:456
       std::panic::catch_unwind::h9c037ef19fbc6aba
       /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panic.rs:137
       std::rt::lang_start_internal::h609ce79df789091f
       /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:128
    14 _main
    
    opened by mohammad-haque 0
  • v1.1.1

    v1.1.1

    [1.1.1] - 2022-03-28

    Fixed

    • Fixed an issue that would prevent the start and end date generated by the --from (-f) and --to (-t) flags from being included in the HTML file if the Trello report was skipped.
    opened by marsavar 0
  • v1.1.0

    v1.1.0

    [1.1.0] - 2022-03-28

    Added

    • It is now possible to pass the --skip-trello flag (or -s in short) to generate a report that does not include Trello cards. Previously, setting a Trello API key and a server token would always include the Trello report; the new flag overrides this behaviour.

    Fixed

    • The tool no longer breaks when the GitHub search response includes pull requests with assignees.
    • If Trello authentication fails (e.g. expired server token), the program no longer terminates prematurely. Instead, an error message is displayed and the final report will not include Trello cards.
    opened by marsavar 0
  • V1.0.1

    V1.0.1

    [1.0.1] - 2022-03-16

    Changed

    • The name of the HTML file generated by the tool now includes the date on which it was created.

    Fixed

    • The tool no longer breaks when GitHub milestones exist in a search result.
    • The title of the HTML file no longer includes an incorrect ([object]) string.
    opened by marsavar 0
  • V1.0.0

    V1.0.0

    [1.0.0] - 2022-02-23

    Added

    • 🎉 The tool now supports Trello integration. In order to make requests to the Trello API, authentication credentials can now be set with the --trello-key and --trello-token flags. The parameters are optional, and if neither is set, the tool will only generate a report containing GitHub pull requests.
    • To support Trello, new structs have been added to the models crate.

    Changed

    • Credentials are now stored on disk with section nesting ([GitHub] for the GitHub personal access token, and [Trello] for the Trello API key and server token). In the previous version of the CLI, no hierarchy was defined and the GitHub auth token was stored in the general section. This means that you will have to re-authenticate with --auth-token when upgrading to v1.0.0.
    • All CLI flags that require the user's input have now been changed from type String to Option<String> to allow the tool to run even when Trello credentials are not set.
    • The Handlebars template now includes a section for Trello boards, which is conditionally rendered.
    opened by marsavar 0
  • V0.1.1

    V0.1.1

    [0.1.1] - 2022-02-16

    Added

    • The tool now outputs descriptive status updates when running.
    • The GuardianPullRequests enum now implements the Display trait.

    Changed

    • In order to decrease the likelihood of hitting GitHub's secondary rate limit, the logic has been changed so that polling stops once the number of fetched items matches the number of the total items in the response.
    • The Args struct now lives in its own module (cli.rs).
    • The body field in the GithubSearchResponseItem struct has been changed from a String type to an Option<String> type to account for empty PR descriptions.

    Fixed

    • The new body type (Option<String>) means that execution no longer halts when encountering a pull request with an empty body.
    opened by marsavar 0
Releases(v2.0.0)
  • v2.0.0(Nov 12, 2022)

    [2.0.0] - 2022-11-12

    Changed

    • Usage of the CLI has changed. You can now use the following subcommands:
      • self-assessment auth <TOKEN> to provide the Github authentication token.
      • self-assessment trello-auth <API_KEY> <TOKEN> to provide the Trello Api key and server token.
      • self-assessment generate-report [--from <YYYY-MM-DD>] [--to <YYYY-MM-DD>] [--skip-trello] to generate a report. The flags in square brackets are optional.

    Fixed

    • Fixed an issue that caused empty Github milestones to exit the CLI execution with an error.
    Source code(tar.gz)
    Source code(zip)
    self-assessment(8.14 MB)
  • v1.1.1(Mar 28, 2022)

  • v1.1.0(Mar 27, 2022)

    [1.1.0] - 2022-03-28

    Added

    • It is now possible to pass the --skip-trello flag (or -s in short) to generate a report that does not include Trello cards. Previously, setting a Trello API key and a server token would always include the Trello report; the new flag overrides this behaviour.

    Fixed

    • The tool no longer breaks when the GitHub search response includes pull requests with assignees.
    • If Trello authentication fails (e.g. expired server token), the program no longer terminates prematurely. Instead, an error message is displayed and the final report will not include Trello cards.
    Source code(tar.gz)
    Source code(zip)
    self-assessment(8.15 MB)
  • v1.0.2(Mar 20, 2022)

  • v1.0.1(Mar 16, 2022)

    [1.0.1] - 2022-03-16

    Changed

    • The name of the HTML file generated by the tool now includes the date on which it was created.

    Fixed

    • The tool no longer breaks when GitHub milestones exist in a search result.
    • The title of the HTML file no longer includes an incorrect ([object]) string.
    Source code(tar.gz)
    Source code(zip)
    self-assessment(8.15 MB)
  • v1.0.0(Feb 23, 2022)

    [1.0.0] - 2022-02-23

    Added

    • 🎉 The tool now supports Trello integration. In order to make requests to the Trello API, authentication credentials can now be set with the --trello-key and --trello-token flags. The parameters are optional, and if neither is set, the tool will only generate a report containing GitHub pull requests.
    • To support Trello, new structs have been added to the models crate.

    Changed

    • Credentials are now stored on disk with section nesting ([GitHub] for the GitHub personal access token, and [Trello] for the Trello API key and server token). In the previous version of the CLI, no hierarchy was defined and the GitHub auth token was stored in the general section. This means that you will have to re-authenticate with --auth-token when upgrading to v1.0.0.
    • All CLI flags that require the user's input have now been changed from type String to Option<String> to allow the tool to run even when Trello credentials are not set.
    • The Handlebars template now includes a section for Trello boards, which is conditionally rendered.
    Source code(tar.gz)
    Source code(zip)
    self-assessment(8.15 MB)
  • v0.1.1(Feb 16, 2022)

    [0.1.1] - 2022-02-16

    Added

    • The tool now outputs descriptive status updates when running.
    • The GuardianPullRequests enum now implements the Display trait.

    Changed

    • In order to decrease the likelihood of hitting GitHub's secondary rate limit, the logic has been changed so that polling stops once the number of fetched items matches the number of the total items in the response.
    • The Args struct now lives in its own module (cli.rs).
    • The body field in the GithubSearchResponseItem struct has been changed from a String type to an Option<String> type to account for empty PR descriptions.

    Fixed

    • The new body type (Option<String>) means that execution no longer halts when encountering a pull request with an empty body.
    Source code(tar.gz)
    Source code(zip)
    self-assessment.zip(4.27 MB)
Owner
The Guardian
The source code of the world's leading liberal voice
The Guardian
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects

Mercy ?? Documentation Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other pro

CyberSuki 2 Nov 27, 2022
CLI for self-bootstrapped Python applications

PyApp PyApp is a CLI wrapper for Python applications that bootstrap themselves at runtime. Each application is configured with environment variables a

Ofek Lev 6 May 10, 2023
Self-contained template system with Handlebars and inline shell scripts

Handlematters Self-contained template system with Handlebars and inline shell scripts Introduction Handlematters is a template system that combines Ha

Keita Urashima 3 Sep 9, 2022
Work-in-progress Rust application that converts C++ header-only libraries to single self-contained headers.

unosolo Work-in-progress Rust application that converts C++ header-only libraries to single self-contained headers. Disclaimer This is my first Rust p

Vittorio Romeo 26 Jul 9, 2021
A self-contained, unopinionated, fast and lightweight executable launcher.

Kickoff ?? A self-contained, unopinionated, fast and lightweight executable launcher. Supported Platforms Platform Host Target aarch64-apple-macos-non

Nimbus 18 Oct 27, 2023
Temporary elevated access management as a self-hosted service

????☁️ S A T O U N K I Temporary elevated access management as a self-hosted service Overview Satounki is a self-hosted service which brings visibilit

جاد 31 Dec 17, 2023
a simple, non-self-describing data-interchange format.

rust-fr 'rust-fr' (aka rust for real) is a simple, non-self-describing data-interchange format. installation You can use either of these methods. Add

Ayush 4 Feb 28, 2024
Standalone analytics provider and realtime dashboard designed for self-hosting.

Stats Stats is a high-performance, standalone analytics provider designed for self-hosting, enabling the collection and viewing of event data from web

Udara Jay 120 Mar 23, 2024
A CLI tool to get help with CLI tools 🐙

A CLI tool to get help with CLI tools ?? halp aims to help find the correct arguments for command-line tools by checking the predefined list of common

Orhun Parmaksız 566 Apr 16, 2023
CLI Tool for tagging and organizing files by tags.

wutag ?? ??️ CLI tool for tagging and organizing files by tags. Install If you use arch Linux and have AUR repositories set up you can use your favour

Wojciech Kępka 32 Dec 6, 2022
CLI tool to bake your fresh and hot MD files

At least once in your Rust dev lifetime you wanted to make sure all code examples in your markdown files are up-to-date, correct and code is formated, but you couldn't make that done with already existing tools - fear not!

Patryk Budzyński 39 May 8, 2021
A CLI tool that allow you to create a temporary new rust project using cargo with already installed dependencies

cargo-temp A CLI tool that allow you to create a new rust project in a temporary directory with already installed dependencies. Install Requires Rust

Yohan Boogaert 61 Oct 31, 2022
qsv - Performant CLI tool to query CSVs through SQL

qsv Performant CLI tool to query CSVs through SQL Installation After cloning the repository, you can install a binary locally using cargo install --pa

Dermot Haughey 3 Oct 28, 2021
😎 A CLI tool for fetching data and displaying it nicely

?? A CLI tool for fetching data and displaying it nicely. (The neofetch for remote data fetching)

Milo 6 Aug 24, 2022
kwctl is the go-to CLI tool for Kubewarden users.

kwctl kwctl is the go-to CLI tool for Kubewarden users. Think of it as the docker CLI tool if you were working with containers. How does kwctl help me

Kubewarden 45 Dec 21, 2022
A Rust CLI tool that helps you enforce Git policies through Git hooks both server and client side

GitPolicyEnforcer This is a command line utility written in Rust, that helps you utilize Git hooks, to enforce various policies. It currently supports

Vagelis Prokopiou 4 Aug 14, 2022
miniserve - a CLI tool to serve files and dirs over HTTP

?? For when you really just want to serve some files over HTTP right now!

Sven-Hendrik Haase 4.1k Jan 6, 2023
A cli tool to download specific GitHub directories or files

cloneit A cli tool to download specific GitHub directories or files. Installation From git git clone https://github.com/alok8bb/cloneit cd cloneit car

Alok 54 Dec 20, 2022
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.

Voila is a domain-specific language designed for doing complex operations to folders & files. It is based on a CLI tool, although you can write your V

Guillem Jara 86 Dec 12, 2022