Note
The ghqc cli is still under development to catch its feature set up to the R package. Additionally compatibility between the two has not bee robustly tested.
cargo build --features cli --releaseUsers can configure ghqc using a configuration repository. Options include:
-
Checklists - Each file to be QCed must have a checklist assigned to it to aide the QCer.
ghqcwill include a Custom, template option. Any additional checklists must be provided in a yaml file or a GitHub Flavored Markdown text file within thechecklistsdirectory of the configuration repository unless otherwise specified by thechecklist_directoryoption described below. -
Logo -
ghqcallows users to include a logo within the resulting QC record PDF. This logo should be found atlogo.pngwithin the configuration repository unless otherwise specified by thelogo_pathoption described below. -
Options - Options can be tuned within the
options.yaml. Available options are:prepended_checklist_note- Allows organizations and users to include a note at the top of each checklist.checklist_display_name- Don't like the default name for the review list of checklists? Change it using this option.logo_path- Change the default record logo location fromlogo.png.checklist_directory- Change the default checklist location fromchecklists.
ghqc configuration setup [GIT]To follow conventions set by the R package while iterating to make the process easier, the above command behaves in one of two ways:
If GHQC_CONFIG_REPO is set, the GIT argument is not required. In this case, ghqc will clone the repository provided to
$XDG_DATA_HOME/ghqc/<repository name>.
If the GIT option is not required, ghqc will clone the repository provided to $XDG_DATA_HOME/ghqc/config.
ghqc configuration statusDisplays the status of the configuration repository like below:
== Directory Information ==
π directory: /Users/wescummings/projects/ghqc/ghqctoolkit/data/ghqc/config
π¦ git repository: a2-ai/ghqc.example_config_repo
Repository is up to date!
π Checklists available in 'checklists': 4
β
Logo found at logo.png
== Checklists Summary ==
π checklist note:
β Note: edit checklist items as needed
- Code Review: 10 checklist items
- Custom: 1 checklist items
- General Script: 3 checklist items
- Report: 7 checklist items
Other commands will look for the configuration repository based on the following priority:
--config-dir- Uses the directory providedGHQC_CONFIG_REPO- Uses$XDG_DATA_HOME/ghqc/<repository name>- Otherwise uses
$XDG_DATA_HOME/ghqc/config
An example repository is set-up for use and reference at https://github.com/a2-ai/ghqc.example_config_repo.
Issues are the unit for QC within ghqc. Each QC has an associated GitHub Issue to track the QC.
Issues are grouped into Milestones for organization.
ghqc issue create
Providing no arguments will take you through an interactive issue creation.
The first step is to either create a new milestone or select an existing one.
π Welcome to GHQC Interactive Mode!
? Select or create a milestone:
π Create new milestone:
> π― Milestone 1
π― QC Round 2
π― EDAThen, select a file. Within a milestone, only one issue can exist for a file to prevent conflicting reviews.
π Welcome to GHQC Interactive Mode!
> Select or create a milestone: π― Milestone 1
? π Enter file path (Tab for autocomplete, directories shown with /): scripts
> scripts/file_1.qmd
scripts/file_2.qmd
π« scripts/file_3.qmd (already has issue)After selecting a milestone and a file to be QCed, select a checklist:
π Welcome to GHQC Interactive Mode!
> Select or create a milestone: π― Milestone 1
> π Enter file path (Tab for autocomplete, directories shown with /): scripts/file_1.qmd
? Select a checklist:
> π Code Review
π Custom
π General Script
π ReportUsers can then assign reviewer(s) to the QC:
π Welcome to GHQC Interactive Mode!
> Select or create a milestone: π― Milestone 1
> π Enter file path (Tab for autocomplete, directories shown with /): scripts/file_1.qmd
> Select a checklist: π Code Review
? π₯ Enter assignee username (use Tab for autocomplete, Enter for none): QCer
QCer
ReviewerLastly, users can add relevant files to the issue:
π Welcome to GHQC Interactive Mode!
> Select or create a milestone: π― Milestone 1
> π Enter file path (Tab for autocomplete, directories shown with /): scripts/file_1.qmd
> Select a checklist: π Code Review
> π₯ Enter assignee username (use Tab for autocomplete, Enter for none): QCer
> π₯ Enter another assignee (current: QCer, use Tab for autocomplete, Enter to finish):
? π Enter relevant file path (Tab for autocomplete, directories shown with /, Enter for none): scripts/
scripts/file_2.qmd
scripts/file_3.qmdAfter preparing the QC, ghqc will create the Issue within the GitHub repository:
π Welcome to GHQC Interactive Mode!
> Select or create a milestone: π― Milestone 1
> π Enter file path (Tab for autocomplete, directories shown with /): scripts/file_1.qmd
> Select a checklist: π Code Review
> π₯ Enter assignee username (use Tab for autocomplete, Enter for none): QCer
> π₯ Enter another assignee (current: QCer, use Tab for autocomplete, Enter to finish):
? π Enter relevant file path (Tab for autocomplete, directories shown with /, Enter for none):
β¨ Creating issue with:
π Milestone: Milestone 1
π File: scripts/file_1.qmd
π Checklist: Code Review
π₯ Assignees: QCer
β
Issue created successfully!
https://github.com/my_organization/my_analysis/issues/4The QC Issue has now been created and ready for review by your QCer!
To review and provide context about how the files change, ghqc provides the ability to comment within the GitHub Issue
and include commit differences.
ghqc issue comment
Providing no arguments will take you through an interactive issue comment posting.
The first step is to select an existing Milestone in which your issue exists.
π¬ Welcome to GHQC Comment Mode!
? Select a milestone:
> π― Milestone 1
π― QC Round 2
π― EDAThen, select an issue.
π¬ Welcome to GHQC Comment Mode!
> Select a milestone: π― Milestone 1
? π« Enter issue title (use Tab for autocomplete):
> scripts/file_1.qmd
scripts/file_2.qmd
scripts/file_3.qmdWe then select two commits to take the file difference between. It will default the most recent file changing commit and the most recent commented on commit. If those are the same, will select the second most recent file changing commit.
π¬ Welcome to GHQC Comment Mode!
> Select a milestone: π― Milestone 1
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
π Commit Status Legend:
π± Initial commit π¬ Has comments β
Approved π Latest π File changed
π Select first commit (press Enter for latest file change):
? Pick commit:
> π 00eadb9b - commit 3
π¬π bf8e8730 - commit 2
π± 32cf8fd6 - commit 1π¬ Welcome to GHQC Comment Mode!
> Select a milestone: π― Milestone 1
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
π Commit Status Legend:
π± Initial commit π¬ Has comments β
Approved π Latest π File changed
π Select first commit (press Enter for latest file change):
> Pick commit: π 00eadb9b - commit 3
π Select second commit for comparison (press Enter for second file change):
? Pick commit:
π 00eadb9b - commit 3
> π¬π bf8e8730 - commit 2
π± 32cf8fd6 - commit 1Lastly, you are able to tune which context you'd like to add to the comment by entering a note and/or including the commit diff.
π¬ Welcome to GHQC Comment Mode!
> Select a milestone: π― Milestone 1
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
π Commit Status Legend:
π± Initial commit π¬ Has comments β
Approved π Latest π File changed
π Select first commit (press Enter for latest file change):
> Pick commit: π 00eadb9b - commit 3
π Select second commit for comparison (press Enter for second file change):
> Pick commit: π¬π bf8e8730 - commit 2
? π Enter optional note for this comment (Enter to skip):
? π Include commit diff in comment? (Y/n) Then, ghqc will post the comment to the selecting Issue within GitHub:
π¬ Welcome to GHQC Comment Mode!
> Select a milestone: π― Milestone 1
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
π Commit Status Legend:
π± Initial commit π¬ Has comments β
Approved π Latest π File changed
π Select first commit (press Enter for latest file change):
> Pick commit: π 00eadb9b - commit 3
π Select second commit for comparison (press Enter for second file change):
> Pick commit: π¬π bf8e8730 - commit 2
? π Enter optional note for this comment (Enter to skip):
? π Include commit diff in comment? (Y/n)
β¨ Creating comment with:
π― Milestone: Milestone 1
π« Issue: #4 - scripts/file_1.qmd
π File: scripts/file_1.qmd
π Current commit: 00eadb9bf2747dffade4415e63e689c1450261bd
π Previous commit: bf8e8730a66f7be13aa0c895bf8dc2acd033751a
π Include diff: Yes
β
Comment Created!
https://github.com/my_organization/my_analysis/issues/4#issuecomment-123456789Once the review has been completed and implemented, the QCer can approve the Issue.
ghqc issue approve
Providing no arguments will take you through an interactive issue approval.
First, select a Milestone containing the Issue to approve.
β
Welcome to GHQC Approve Mode!
? Select a milestone:
> π― Milestone 1
π― QC Round 2
π― EDAThen, select the issue.
β
Welcome to GHQC Approve Mode!
> Select a milestone: π― Milestone 1
? π« Enter issue title (use Tab for autocomplete):
> scripts/file_1.qmd
scripts/file_2.qmd
scripts/file_3.qmdNext, select the commit to approve. Defaults to the latest commit.
β
Welcome to GHQC Approve Mode!
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
π Commit Status Legend:
π± Initial commit π¬ Has comments β
Approved π Latest π File changed
π Select commit to approve (press Enter for latest):
? Pick commit:
> π¬π 00eadb9b - commit 3
π¬π bf8e8730 - commit 2
π± 32cf8fd6 - commit 1Lastly, optionally include a note to provide additional context to the approval
β
Welcome to GHQC Approve Mode!
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
π Commit Status Legend:
π± Initial commit π¬ Has comments β
Approved π Latest π File changed
π Select commit to approve (press Enter for latest):
> Pick commit: π¬π 00eadb9b - commit 3
? π Enter optional note for this comment (Enter to skip):ghqc will then post a comment indicating approval and close the issue.
β
Welcome to GHQC Approve Mode!
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
π Commit Status Legend:
π± Initial commit π¬ Has comments β
Approved π Latest π File changed
π Select commit to approve (press Enter for latest):
> Pick commit: π¬π 00eadb9b - commit 3
? π Enter optional note for this comment (Enter to skip):
β¨ Creating approval with:
π― Milestone: Milestone 1
π« Issue: #4 - scripts/file_1.qmd
π File: scripts/file_1.qmd
π Commit: 00eadb9bf2747dffade4415e63e689c1450261bd
β
Approval created and issue closed!
https://github.com/my_organization/my_analysis/issues/4#issuecomment-987654321If for some reason an approval should be overturned, we must unapprove the Issue.
ghqc issue unapproveProviding no arguments will take you through an interactive issue unapproval.
First, select the Milestone containing the Issue to unapprove.
π« Welcome to GHQC Unapprove Mode!
? Select a milestone:
> π― Milestone 1
π― QC Round 2
π― EDAThen, select a closed issue to unapprove.
π« Welcome to GHQC Unapprove Mode!
> Select a milestone: π― Milestone 1
? π« Enter issue title (use Tab for autocomplete):
> scripts/file_1.qmd
models/1001.modLastly, provide a reason to be included with the unapproval.
π« Welcome to GHQC Unapprove Mode!
> Select a milestone: π― Milestone 1
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
? π Enter reason for unapproval: Found more changes to be madeThen, ghqc will post the comment and re-open the Issue.
π« Welcome to GHQC Unapprove Mode!
> Select a milestone: π― Milestone 1
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
? π Enter reason for unapproval: Found more changes to be made
β¨ Creating unapproval with:
π― Milestone: Milestone 1
π« Issue: #4 - scripts/file_1.qmd
π« Reason: Found more changes to be made
π« Issue unapproved and reopened!
https://github.com/A2-ai/ghqctoolkit/issues/4#issuecomment-192837465Provides the status of the issue.
Providing no arguments will take you through an interactive issue status.
ghqc issue status
First, select a Milestone containing the Issue of interest.
β
Welcome to GHQC Approve Mode!
? Select a milestone:
> π― Milestone 1
π― QC Round 2
π― EDAThen, select the issue.
β
Welcome to GHQC Approve Mode!
> Select a milestone: π― Milestone 1
? π« Enter issue title (use Tab for autocomplete):
> scripts/file_1.qmd
scripts/file_2.qmd
scripts/file_3.qmdghqc will then print the status of the issue:
β
Welcome to GHQC Approve Mode!
> Select a milestone: π― Milestone 1
> π« Enter issue title (use Tab for autocomplete): scripts/file_1.qmd
- File: scripts/file_1.qmd
- Branch: analysis
- Issue State: open
- QC Status: File change in `bb23a12` not commented
- Git Status: File is up to date!
- Checklist Summary: 0/5 (0.0%)
- Code Quality: 0/2 (0.0%)
- Scientific Review: 0/3 (0.0%)Similar to the issue status, we can get a summary for all issues in the milestone(s).
ghqc milestone statusProviding no arguments will take you through an interactive milestone status.
First, select All Milestones or as many as you'd like:
π Welcome to GHQC Milestone Status Mode!
? π How would you like to select milestones?
π Select All Milestones
> π― Choose Specific Milestonesπ Welcome to GHQC Milestone Status Mode!
> π How would you like to select milestones? π― Choose Specific Milestones
? π Select milestones to check:
> [x] Milestone 1 (3)
[x] QC Round 2 (1)
[ ] EDA (8)Then, ghqc will print a summary table of the issues within the selected Milestone(s)
File | Milestone | Branch | Issue State | QC Status | Git Status | Checklist
---------------------------------+-------------+------------+-------------+--------------------+------------+------------
scripts/file_1.qmd | Milestone 1 | analysis | open | Changes to comment | Up to date | 0/5 (0.0%)
scripts/file_2.qmd | Milestone 1 | analysis | open | Changes to comment | Up to date | 6/8 (75.0%)
scripts/file_3.qmd | Milestone 1 | analysis | open | In progress | Up to date | 3/10 (30.0%)
scripts/file_4.qmd | QC Round 2 | QC | closed | Approved | Up to date | 15/15 (100.0%)
At the end of a QC, users may create an archive.
ghqc milestone archiveProviding no arguments will take you through an interactive milestone status.
First, select All Milestones or as many as you'd like:
π Welcome to GHQC Milestone Archive Mode!
? π How would you like to select milestones?
π Select All Milestones
> π― Choose Specific Milestonesπ Welcome to GHQC Milestone Status Mode!
> π How would you like to select milestones? π― Choose Specific Milestones
? π Select milestones to check:
> [x] Milestone 1 (3)
[ ] QC Round 2 (1)
[ ] EDA (8)Users can then provide a custom record file name. Default is <repo name>-<milestone names, separated by '-'>.pdf
π Welcome to GHQC Milestone Status Mode!
> π How would you like to select milestones? π― Choose Specific Milestones
> π Select milestones to check: Milestone 1 (3)
? π Enter record file name (Enter for default): Lastly, ghqc will create pdf record of the selected Milestones.
π Welcome to GHQC Milestone Status Mode!
> π How would you like to select milestones? π― Choose Specific Milestones
> π Select milestones to check: Milestone 1 (3)
? π Enter record file name (Enter for default):
β
Record successfully generated at my_analysis-Milestone-1.pdf