Skip to content

Commit

Permalink
chore: Fixes/cleanup for 720ee58
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenden committed Jul 28, 2023
1 parent d2529c0 commit 73c58ae
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public <R extends INcdReportRepositoryDescriptor> void processRepository(

private <R extends INcdReportRepositoryDescriptor> void processRepository(R repoDescriptor, INcdReportBranchCommitGenerator<R> branchCommitGenerator) {
var branchCommitsCollector = new NcdReportRepositoryBranchCommitCollector(authorCollector, repoDescriptor);
writers.progressWriter().writeI18nProgress("fcli.util.ncd-report.loading.commits", repoDescriptor.getFullName());
writers.progressWriter().writeI18nProgress("fcli.license.ncd-report.loading.commits", repoDescriptor.getFullName());
branchCommitGenerator.generateBranchCommitData(repoDescriptor, branchCommitsCollector);
if ( branchCommitsCollector.isEmpty() ) {
repositoryCollector.reportRepository(repoDescriptor, NcdReportRepositoryReportingStatus.empty, "No commits found");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected void generateResults() {
private void generateResults(NcdReportGitHubOrganizationConfig orgConfig) {
String orgName = orgConfig.getName();
try {
resultsCollector().progressWriter().writeI18nProgress("fcli.util.ncd-report.loading.github-repositories", orgName);
resultsCollector().progressWriter().writeI18nProgress("fcli.license.ncd-report.loading.github-repositories", orgName);
HttpRequest<?> req = unirest().get("/orgs/{org}/repos?type=all&per_page=100").routeParam("org", orgName);
GitHubPagingHelper.pagedRequest(req, ArrayNode.class)
.ifSuccess(r->r.getBody().forEach(repo->
Expand Down Expand Up @@ -133,7 +133,7 @@ private boolean generateCommitDataForBranches(INcdReportRepositoryBranchCommitCo
.format(DateTimeFormatter.ISO_INSTANT);
boolean commitsFound = false;
for ( var branchDescriptor : branchDescriptors ) {
resultsCollector().progressWriter().writeI18nProgress("fcli.util.ncd-report.loading.branch-commits", repoDescriptor.getFullName(), branchDescriptor.getName());
resultsCollector().progressWriter().writeI18nProgress("fcli.license.ncd-report.loading.branch-commits", repoDescriptor.getFullName(), branchDescriptor.getName());
HttpRequest<?> req = getCommitsRequest(repoDescriptor, branchDescriptor, 100)
.queryString("since", since);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void generateResults(NcdReportGitLabGroupConfig groupConfig) {
String groupId = groupConfig.getId();
try {
boolean includeSubgroups = groupConfig.getIncludeSubgroups().orElse(sourceConfig().getIncludeSubgroups().orElse(true));
resultsCollector().progressWriter().writeI18nProgress("fcli.util.ncd-report.loading.gitlab-repositories", groupId);
resultsCollector().progressWriter().writeI18nProgress("fcli.license.ncd-report.loading.gitlab-repositories", groupId);
HttpRequest<?> req = unirest().get("/api/v4/groups/{id}/projects?per_page=100")
.routeParam("id", groupId)
.queryString("include_subgroups", includeSubgroups);
Expand Down Expand Up @@ -139,7 +139,7 @@ private boolean generateCommitDataForBranches(INcdReportRepositoryBranchCommitCo
.format(DateTimeFormatter.ISO_INSTANT);
boolean commitsFound = false;
for ( var branchDescriptor : branchDescriptors ) {
resultsCollector().progressWriter().writeI18nProgress("fcli.util.ncd-report.loading.branch-commits", repoDescriptor.getFullName(), branchDescriptor.getName());
resultsCollector().progressWriter().writeI18nProgress("fcli.license.ncd-report.loading.branch-commits", repoDescriptor.getFullName(), branchDescriptor.getName());
HttpRequest<?> req = getCommitsRequest(repoDescriptor, branchDescriptor, 100)
.queryString("since", since);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,48 +47,6 @@ fcli.util.crypto.encrypt.prompt = Value to encrypt:
fcli.util.crypto.decrypt.usage.header = Decrypt a value.
fcli.util.crypto.decrypt.prompt = Value to decrypt:

# fcli util msp-report
fcli.util.msp-report.usage.header = Configure and generate 'Managed Service Provider' (MSP) reports.
fcli.util.msp-report.generate.usage.header = Generate a 'Managed Service Provider' (MSP) report.
fcli.util.msp-report.generate.usage.description.0 = This command generates a 'Managed Service Provider' (MSP) report based on configuration settings defined in a configuration file. A sample configuration file can be generated using the 'fcli util msp-report generate-config' command.
fcli.util.msp-report.generate.usage.description.1 = \nThe configuration file includes settings for specifying one or more SSC instances from which to load MSP reporting data, and for specifying MSP (contract) information.
fcli.util.msp-report.generate.usage.description.2 = \nThe generated report consists of multiple files, written to either a directory or zip-file. The primary output file is 'summary.txt' that contains various statistics, including the number of application and scan entitlements consumed during the reporting period. Various CSV files providing proof, like the number of entitlements consumed per application, what artifacts were processed, and which artifacts contributed to the entitlement consumption, are generated in the details directory of the report.
fcli.util.msp-report.generate.usage.description.3 = \nThe generated 'checksums.sha256' file can be used to verify integrity of all generated files, using a command like 'sha256sum -c checksums.sha256'.
fcli.util.msp-report.generate.usage.description.4 = \nThis command requires the following SSC application version attributes to be configured in SSC:
fcli.util.msp-report.generate.usage.description.5 = - MSP_License_Type: Required, Single-Select List, Values: Application, Scan, Demo
fcli.util.msp-report.generate.usage.description.6 = - MSP_End_Customer_Name - Optional (for demo applications), Single Line Text
fcli.util.msp-report.generate.usage.description.7 = - MSP_End_Customer_Location - Optional (for demo applications), Single Line Text
fcli.util.msp-report.generate.usage.description.8 = \nNote that all versions within a single application should provide the same values for these attributes.
fcli.util.msp-report.generate.config = Configuration file; sample can be generated using the 'generate-config' command.
fcli.util.msp-report.generate.start-date = Reporting period start date. Format: yyyy-MM-dd, for example 2023-01-01.
fcli.util.msp-report.generate.end-date = Reporting period start date. Format: yyyy-MM-dd, for example 2023-03-31.
fcli.util.msp-report.generate.confirm = Confirm delete of existing report output location.
fcli.util.msp-report.generate.confirmPrompt = Confirm delete of existing output location %s?
fcli.util.msp-report.generate.processing.app = Processing application %s
fcli.util.msp-report.generate.processing.appversion = Processing application version %s
fcli.util.msp-report.generate.warn.usingUploadDate = WARN: No scan date found for artifact id %s (%s), using upload date instead
fcli.util.msp-report.generate-config.usage.header = Generate a sample configuration file for use by the 'generate' command.
fcli.util.msp-report.generate-config.config = Name of the sample configuration file to be generated.
fcli.util.msp-report.generate-config.confirm = Confirm overwrite of existing configuration file.

# fcli util ncd-report
fcli.util.ncd-report.usage.header = Configure and generate 'Number of Contributing Developers' (NCD) reports.
fcli.util.ncd-report.generate.usage.header = Generate a 'Number of Contributing Developers' (NCD) report.
fcli.util.ncd-report.generate.usage.description.0 = This command generates a 'Number of Contributing Developers' (NCD) report based on configuration settings defined in a configuration file. A sample configuration file can be generated using the 'fcli util ncd-report generate-config' command.\n
fcli.util.ncd-report.generate.usage.description.1 = The configuration file includes rich settings for specifying the source code repositories from which to load contributing developer data (supporting multiple Source Code Management (SCM) systems), and for ignoring and de-duplicating contributing authors. \n
fcli.util.ncd-report.generate.usage.description.2 = The generated report consists of multiple files, written to either a directory or zip-file. The primary output file is 'summary.txt' that contains various statistics, including the de-duplicated count of contributing developers. Various CSV files are generated with supporting proof, like the list of contributing authors, the list of commits that have been processed, and the list of repositories that have been processed.\n
fcli.util.ncd-report.generate.usage.description.3 = The generated 'checksums.sha256' file can be used to verify integrity of all generated files, using a command like 'sha256sum -c checksums.sha256'.
fcli.util.ncd-report.generate.config = Configuration file; sample can be generated using the 'generate-config' command.
fcli.util.ncd-report.generate.confirm = Confirm delete of existing report output location.
fcli.util.ncd-report.generate.confirmPrompt = Confirm delete of existing output location %s?
fcli.util.ncd-report.generate-config.usage.header = Generate a sample configuration file for use by the 'generate' command.
fcli.util.ncd-report.generate-config.config = Name of the sample configuration file to be generated.
fcli.util.ncd-report.generate-config.confirm = Confirm overwrite of existing configuration file.
fcli.util.ncd-report.loading.commits = Loading commits for repository: %s
fcli.util.ncd-report.loading.branch-commits = Loading commits for branch %s:%s
fcli.util.ncd-report.loading.github-repositories = Loading repositories for GitHub organization: %s
fcli.util.ncd-report.loading.gitlab-repositories = Loading repositories for GitLab group: %s

# fcli util sample-data
fcli.util.sample-data.usage.header = Generate sample data
fcli.util.sample-data.usage.description = These commands generate and output a fixed set of sample data \
Expand Down Expand Up @@ -136,10 +94,6 @@ fcli.util.all-commands.list.output.header.optionsString = Options
# The following are technical properties that shouldn't be internationalized ####################################
#################################################################################################################
fcli.util.all-commands.list.output.table.options = command,hidden,runnable,usageHeader
fcli.util.msp-report.generate.output.table.options = reportPath,summary.errorCount
fcli.util.msp-report.generate-config.output.table.options = path
fcli.util.ncd-report.generate.output.table.options = reportPath,summary.errorCount
fcli.util.ncd-report.generate-config.output.table.options = path
fcli.util.state.clear.output.table.options = name,type
# Empty on purpose; output columns depend on variable contents, so we don't want default variable columns
fcli.util.variable.contents.output.table.options =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class NcdReportSpec extends FcliBaseSpec {

@Requires({env.FCLI_FT_GITHUB_TOKEN && env.FCLI_FT_GITLAB_TOKEN})
def "generate-zip"() {
def args = "util ncd-report generate -y -c ${configFile} -z ${reportOutputZip}"
def args = "license ncd-report generate -y -c ${configFile} -z ${reportOutputZip}"
when:
def result = Fcli.run(args)
then:
Expand Down

0 comments on commit 73c58ae

Please sign in to comment.