-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#1715] Add RepoSense CLI Wizard Walkthrough #1950
Open
sikai00
wants to merge
33
commits into
reposense:master
Choose a base branch
from
sikai00:1715-reposense-cli-wizard
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
56b693a
Add DES skeleton code
sikai00 306d157
Add docs
sikai00 a26facc
Fix import groups in test
sikai00 534ed26
Fix prompt adding ordering
sikai00 845abe3
Merge pull request #1 from sikai00/1715-add-skeleton
sikai00 bcf29ca
Add wizard cli flag to ArgsParser
MarcusTXK 96c24c6
Add view prompt and optional prompt
MarcusTXK 9b39e50
Add repo prompt and update since prompt to be optinal
MarcusTXK d30c0e8
Fix java.util.NoSuchElementException when running wizard via gradle
MarcusTXK a713677
Fix import wildcard
MarcusTXK 9a62d24
Refactor optinal prompt and Update prompt field names
MarcusTXK 181a62c
Update optional prompt
MarcusTXK 15577ae
Fix checkstyle error
MarcusTXK e83fbf0
Update WizardRunnerTest
MarcusTXK ac8fd12
Update wizard input builder
MarcusTXK ee5e006
Merge pull request #2 from MarcusTXK/1715-reposense-cli-wizard
sikai00 f80e0a5
Merge branch 'master' into 1715-reposense-cli-wizard
sikai00 8b1b7b4
Add UntilPrompt
sikai00 8cd9366
Merge pull request #3 from sikai00/1715-add-untilprompt
sikai00 9b47b33
Add documentaion for init
sikai00 8eb642d
Reorganise file structure
sikai00 e006376
Rename prompts to prompt
sikai00 4cadcca
Update cli.md
MarcusTXK 33cee39
Merge pull request #4 from sikai00/1715-add-documentation
MarcusTXK 4b790d8
Merge pull request #5 from sikai00/1715-reorganise
MarcusTXK d45ecde
Remove redundant translatecommandline method declaration
sikai00 70297b3
Fix checkstyle
sikai00 60563c0
Fix addRepos missing whitespace bug, Remove unused methods in inputBu…
MarcusTXK 41e7669
Fix failing WizardRunner tests
MarcusTXK 561f60d
Merge branch 'master' into 1715-reposense-cli-wizard
MarcusTXK f2815d6
Add docs to using the init flag
sikai00 9c3f6c2
Update ViewPrompt
MarcusTXK 61e7195
Merge branch '1715-reposense-cli-wizard' of https://github.com/sikai0…
MarcusTXK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{% set title = "Appendix: Using `--init` flag" %} | ||
<frontmatter> | ||
title: "{{ title | safe }}" | ||
</frontmatter> | ||
|
||
{% from 'scripts/macros.njk' import embed, step with context %} | ||
|
||
<h1 class="display-4"><md>{{ title }}</md></h1> | ||
|
||
<div class="lead"> | ||
|
||
The `--init` flag makes it easier for new users to get into using RepoSense, by guiding them step-by-step through a wizard with the most essential flags. | ||
</div> | ||
|
||
This guide serves to assist new users in understanding what the `--init` flag is doing, and eventually helps them understand how to use RepoSense without the `init` flag. | ||
|
||
If you have yet to do so, download the latest JAR file from our releases. The instructions are given below. You may ignore Step 3, as the `init` flag supersedes it. | ||
|
||
{{ embed("**Generating reports → Generating reports locally**", "generatingReports.md#section-generating-reports-locally") }} | ||
|
||
### Explanation of each step | ||
|
||
#### List of repository locations to be analyzed: `--repos` | ||
|
||
Upon using `java -jar RepoSense.java --init`, the wizard will ask for a list of repository locations, separated by spaces. | ||
|
||
This list of repository locations is necessary, as it will be the repositories analyzed by RepoSense at the end of the wizard. | ||
|
||
RepoSense accepts both remote Git repository HTTPS links, as well as paths to local Git repositories. | ||
|
||
Given below is the actual CLI flag being used. These embedded subsections will be given throughout this guide to help you pinpoint and locate it in your future references. | ||
|
||
{{ embed("**CLI syntax reference → `--repos`**", "cli.md#section-repos") }} | ||
|
||
<br> | ||
|
||
#### Start date of the analysis: `--since` | ||
|
||
The wizard will ask for the start date of the period of the analysis next. | ||
|
||
The start date, by default, will be one month before the current date. It is hence not necessary to include when you are using the CLI to run RepoSense, but it is likely that you will want to analyze a period with a different starting date. | ||
|
||
Given below is the actual CLI flag being used. | ||
|
||
{{ embed("**CLI syntax reference → `--since`**", "cli.md#section-since") }} | ||
|
||
#### Start date of the analysis: `--until` | ||
|
||
The wizard will ask for the until date of the period of the analysis next. | ||
|
||
The until date, by default, will be the current date. Again, it is not necessary to include when you are using the CLI to run RepoSense. | ||
|
||
Given below is the actual CLI flag being used. | ||
|
||
{{ embed("**CLI syntax reference → `--until`**", "cli.md#section-until") }} | ||
|
||
#### Viewing the report locally: `--view` | ||
|
||
The wizard will ask if you want to start a local server to view the report immediately after the report is generated. By indicating `Y`, a server will be started on your computer on port 9000, where the report can be viewed at http://localhost:9000/. | ||
|
||
This flag is used without any arguments in this basic wizard. | ||
|
||
Given below is the actual CLI flag being used. | ||
|
||
{{ embed("**CLI syntax reference → `--view`**", "cli.md#section-view") }} | ||
|
||
<br> | ||
|
||
### Conclusion | ||
|
||
At this stage, the `--init` wizard would have completed, and the generation of the RepoSense report is underway. It may take a few seconds to a few minutes, depending on the number of repositories entered, as well as your network speed. | ||
|
||
After the report generates, you may want to proceed to [Using reports](usingReports.html) in order to better understand the interface and how you can use the report generated by RepoSense. You may also want to take a closer look at the other config flags provided by RepoSense at [CLI syntax reference](cli.html) to understand what other features are available. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package reposense.model; | ||
|
||
/** | ||
* Represents command line arguments user supplied when running the program with mandatory field -init. | ||
*/ | ||
public class WizardCliArguments extends CliArguments { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package reposense.wizard; | ||
|
||
import reposense.wizard.prompt.OptionalSincePrompt; | ||
import reposense.wizard.prompt.OptionalUntilPrompt; | ||
import reposense.wizard.prompt.Prompt; | ||
import reposense.wizard.prompt.RepoPrompt; | ||
import reposense.wizard.prompt.ViewPrompt; | ||
|
||
/** | ||
* Represents a basic wizard run. | ||
*/ | ||
public class BasicWizard extends Wizard { | ||
private static final Prompt[] INITIAL_PROMPTS = new Prompt[] { | ||
new RepoPrompt(), | ||
new OptionalSincePrompt(), | ||
new OptionalUntilPrompt(), | ||
new ViewPrompt() | ||
}; | ||
public BasicWizard() { | ||
super(INITIAL_PROMPTS); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it myself and I don't think it makes a lot of sense to put the repo last. I think it should be first since I'm usually thinking of what I want to analyze and then the time interval to analyze rather than the other way around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, lets change it to be the first.