From 51103e7d8926b4a73b7aee8029bb0a9798ecb5f1 Mon Sep 17 00:00:00 2001 From: Charisma Kausar <68203159+ckcherry23@users.noreply.github.com> Date: Sun, 12 May 2024 23:22:59 +0800 Subject: [PATCH] Revert "[#2170] Add Blurbs for Repos (#2191)" This reverts commit f4cad78c41007171b1f1a9f4e61baa8cfe71c372. --- build.gradle | 1 - config/blurbs.md | 2 - docs/ug/blurbs.md | 5 - docs/ug/cli.md | 2 +- docs/ug/configFiles.md | 14 -- docs/ug/customizingReports.md | 10 +- frontend/cypress/config/blurbs.md | 11 -- .../tests/chartView/chartView_blurbs.cy.js | 34 ---- frontend/src/app.vue | 2 - frontend/src/components/c-markdown-chunk.vue | 30 ---- frontend/src/components/c-summary-charts.vue | 44 +---- frontend/src/store/store.ts | 4 - frontend/src/types/vuex.d.ts | 1 - frontend/src/types/window.ts | 1 - frontend/src/types/zod/summary-type.ts | 3 - frontend/src/utils/api.ts | 3 - src/main/java/reposense/RepoSense.java | 10 +- src/main/java/reposense/model/BlurbMap.java | 46 ------ .../java/reposense/model/CliArguments.java | 16 -- .../java/reposense/parser/ArgsParser.java | 29 ---- .../reposense/parser/BlurbMarkdownParser.java | 151 ------------------ .../java/reposense/parser/MarkdownParser.java | 32 ---- .../exceptions/InvalidMarkdownException.java | 10 -- .../reposense/report/ReportGenerator.java | 9 +- .../java/reposense/report/SummaryJson.java | 10 +- .../30daysFromUntilDate/expected/summary.json | 92 +---------- .../expected/summary.json | 92 +---------- .../expected/summary.json | 92 +---------- .../resources/ConfigSystemTest/blurbs.md | 14 -- .../expected/summary.json | 92 +---------- .../expected/summary.json | 92 +---------- .../expected/summary.json | 92 +---------- .../testRelativePathing/summary.json | 48 +----- .../testSameFinalDirectory/summary.json | 59 +------ .../java/reposense/model/BlurbMapTest.java | 33 ---- .../parser/BlurbMarkdownParserTest.java | 101 ------------ .../BlurbMarkdownParserTest/empty_blurbs.md | 0 .../malformed_delimiter_blurb.md | 7 - .../malformed_url_blurb.md | 2 - .../multiline_blurb.md | 10 -- .../multiple_blurbs.md | 12 -- 41 files changed, 18 insertions(+), 1300 deletions(-) delete mode 100644 config/blurbs.md delete mode 100644 docs/ug/blurbs.md delete mode 100644 frontend/cypress/config/blurbs.md delete mode 100644 frontend/cypress/tests/chartView/chartView_blurbs.cy.js delete mode 100644 frontend/src/components/c-markdown-chunk.vue delete mode 100644 src/main/java/reposense/model/BlurbMap.java delete mode 100644 src/main/java/reposense/parser/BlurbMarkdownParser.java delete mode 100644 src/main/java/reposense/parser/MarkdownParser.java delete mode 100644 src/main/java/reposense/parser/exceptions/InvalidMarkdownException.java delete mode 100644 src/systemtest/resources/ConfigSystemTest/blurbs.md delete mode 100644 src/test/java/reposense/model/BlurbMapTest.java delete mode 100644 src/test/java/reposense/parser/BlurbMarkdownParserTest.java delete mode 100644 src/test/resources/BlurbMarkdownParserTest/empty_blurbs.md delete mode 100644 src/test/resources/BlurbMarkdownParserTest/malformed_delimiter_blurb.md delete mode 100644 src/test/resources/BlurbMarkdownParserTest/malformed_url_blurb.md delete mode 100644 src/test/resources/BlurbMarkdownParserTest/multiline_blurb.md delete mode 100644 src/test/resources/BlurbMarkdownParserTest/multiple_blurbs.md diff --git a/build.gradle b/build.gradle index 70188931d8..b5827976aa 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,6 @@ dependencies { implementation group: 'org.apache.ant', name: 'ant', version: '1.10.12' implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.9.0' implementation group: 'org.fusesource.jansi', name: 'jansi', version: '2.4.0' - implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.17.0' testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: jUnitVersion testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: jUnitVersion diff --git a/config/blurbs.md b/config/blurbs.md deleted file mode 100644 index 6ccea2c23e..0000000000 --- a/config/blurbs.md +++ /dev/null @@ -1,2 +0,0 @@ -https://github.com/reposense/testrepo-Alpha/tree/master -Master branch of testrepo-Alpha diff --git a/docs/ug/blurbs.md b/docs/ug/blurbs.md deleted file mode 100644 index 4219a83fb3..0000000000 --- a/docs/ug/blurbs.md +++ /dev/null @@ -1,5 +0,0 @@ -https://github.com/reposense/RepoSense/tree/cypress -Cypress branch of RepoSense ------------------------------------- -https://github.com/reposense/publish-RepoSense/tree/master -Publishing branch of RepoSense diff --git a/docs/ug/cli.md b/docs/ug/cli.md index 02f5cab297..550713969c 100644 --- a/docs/ug/cli.md +++ b/docs/ug/cli.md @@ -68,7 +68,7 @@ partial credit.
**`--config CONFIG_DIRECTORY`**: Specifies that config files located in `CONFIG_DIRECTORY` should be used to customize the report. -* Parameter: `CONFIG_DIRECTORY` The directory containing the config files. Should contain a `repo-config.csv` file. Optionally, can contain an `author-config.csv` file or/and a `group-config.csv` file or/and a `report-config.json` file or/and a `blurbs.md` file. +* Parameter: `CONFIG_DIRECTORY` The directory containing the config files. Should contain a `repo-config.csv` file. Optionally, can contain an `author-config.csv` file or/and a `group-config.csv` file or/and a `report-config.json` file. * Alias: `-c` * Example: `java -jar RepoSense.jar --config ./config` diff --git a/docs/ug/configFiles.md b/docs/ug/configFiles.md index 5a9c1745c2..1797f8e4ea 100644 --- a/docs/ug/configFiles.md +++ b/docs/ug/configFiles.md @@ -209,17 +209,3 @@ Note: Symbols such as `"`, `!`, `/` etc. in your author name will be omitted, wh
- - - -
- -## `blurbs.md` - -You can optionally use `blurbs.md` to add blurbs in Markdown syntax for repository branches. These blurbs will be seen when grouping by `Repo/Branch`. ([example](https://github.com/reposense/RepoSense/blob/master/docs/ug/blurbs.md)) - -**Format**: -* First line in section: Link to the repository branch. -* Second line onwards: Blurb content. -* Delimiter: ``. Everything on the line after the delimiter will be ignored. -
diff --git a/docs/ug/customizingReports.md b/docs/ug/customizingReports.md index 531ae94442..da6ad7f49e 100644 --- a/docs/ug/customizingReports.md +++ b/docs/ug/customizingReports.md @@ -62,9 +62,8 @@ In both instances, it is **necessary to commit any changes** for them to be dete -### Personalizing Reports +### Add a title -#### Add a title A title component can be added by creating a file titled `title.md` in the assets directory. You can specify the assets directory according to the reference below: {{ embed("Appendix: **CLI syntax reference → `assets` flag**", "cli.md#section-assets") }} @@ -74,10 +73,3 @@ The title can render a combination of Markdown/HTML and plaintext ([example](htt Do note that the width of the title is bound by the width of the left panel. For more information on how to use Markdown, see the [Markdown Guide](https://www.markdownguide.org/). - -#### Add blurbs for branches -A blurb can be added for a repository branch by creating a file titled `blurbs.md` in the config directory. The blurbs will be visible when grouping by `Repo/Branch`. The format of the file is given below: -{{ embed("Appendix: **Config files format**", "configFiles.md#section-blurbs") }} - -Specifying the config directory can be done as follows: -{{ embed("Appendix: **CLI syntax reference → `config` flag**", "cli.md#section-config") }} diff --git a/frontend/cypress/config/blurbs.md b/frontend/cypress/config/blurbs.md deleted file mode 100644 index aec0130427..0000000000 --- a/frontend/cypress/config/blurbs.md +++ /dev/null @@ -1,11 +0,0 @@ -https://github.com/reposense/RepoSense/tree/cypress -first blurb ------------------------------------- -https://gitlab.com/reposense/testrepo-gitlab/-/tree/main -unseen blurb ------------------------------------- -https://github.com/reposense/publish-RepoSense/tree/master -## third blurb in h2 markdown tag ------------------------------------- -https://github.com/reposense/RepoSense-auth-helper/tree/master -

second blurb in h1 tag

diff --git a/frontend/cypress/tests/chartView/chartView_blurbs.cy.js b/frontend/cypress/tests/chartView/chartView_blurbs.cy.js deleted file mode 100644 index 71c5d62902..0000000000 --- a/frontend/cypress/tests/chartView/chartView_blurbs.cy.js +++ /dev/null @@ -1,34 +0,0 @@ -describe('blurbs', () => { - it('shows blurbs', () => { - cy.get('.markdown.blurb') - .first() - .should('contain', 'first blurb'); - - cy.get('.markdown.blurb') - .eq(1) - .should('contain', 'second blurb'); - - cy.get('.markdown.blurb') - .eq(2) - .should('contain', 'third blurb'); - }); - - it('has the correct number of valid blurbs', () => { - cy.get('.markdown.blurb') - .should('have.length', 3); - }); - - it('processes markdown in blurbs', () => { - cy.get('.markdown.blurb') - .eq(1) - .find('h1') - .contains('second blurb in h1 tag'); - }); - - it('processes html in blurbs', () => { - cy.get('.markdown.blurb') - .eq(2) - .find('h2') - .contains('third blurb in h2 markdown tag'); - }); -}); diff --git a/frontend/src/app.vue b/frontend/src/app.vue index 0c2959d0a6..fa6b442f4a 100644 --- a/frontend/src/app.vue +++ b/frontend/src/app.vue @@ -122,7 +122,6 @@ const app = defineComponent({ reportGenerationTime, errorMessages, names, - blurbMap, } = summary; this.creationDate = creationDate; this.reportGenerationTime = reportGenerationTime; @@ -135,7 +134,6 @@ const app = defineComponent({ this.getUsers(); this.renderTabHash(); this.userUpdated = true; - this.$store.commit('setBlurbMap', blurbMap); } catch (error) { window.alert(error); } finally { diff --git a/frontend/src/components/c-markdown-chunk.vue b/frontend/src/components/c-markdown-chunk.vue deleted file mode 100644 index 47dccb392d..0000000000 --- a/frontend/src/components/c-markdown-chunk.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - - - diff --git a/frontend/src/components/c-summary-charts.vue b/frontend/src/components/c-summary-charts.vue index bb0822eeb6..437b23e5ea 100644 --- a/frontend/src/components/c-summary-charts.vue +++ b/frontend/src/components/c-summary-charts.vue @@ -141,8 +141,9 @@ ) font-awesome-icon.icon-button(icon="clipboard") span.tooltip-text(v-bind:ref="`summary-charts-${i}-copy-iframe`") Click to copy iframe link for group + .tooltip.summary-chart__title--percentile( - v-if="sortGroupSelection.includes('totalCommits')" + v-if="sortGroupSelection.includes('totalCommits')" ) {{ getPercentile(i) }} %  span.tooltip-text.right-aligned {{ getPercentileExplanation(i) }} .summary-charts__title--tags( @@ -157,14 +158,6 @@ ) font-awesome-icon(icon="tags") span  {{ tag }} - - .blurbWrapper( - v-if="filterGroupSelection === 'groupByRepos'", - ) - c-markdown-chunk.blurb( - v-bind:markdown-text="getBlurb(repo[0])" - ) - .summary-charts__fileType--breakdown(v-if="filterBreakdown") template(v-if="filterGroupSelection !== 'groupByNone'") .summary-charts__fileType--breakdown__legend( @@ -344,7 +337,6 @@ import brokenLinkDisabler from '../mixin/brokenLinkMixin'; import tooltipPositioner from '../mixin/dynamicTooltipMixin'; import cRamp from './c-ramp.vue'; import cStackedBarChart from './c-stacked-bar-chart.vue'; -import cMarkdownChunk from './c-markdown-chunk.vue'; import { Bar, Repo, User } from '../types/types'; import { FilterGroupSelection, FilterTimeFrame, SortGroupSelection } from '../types/summary'; import { StoreState, ZoomInfo } from '../types/vuex.d'; @@ -355,7 +347,6 @@ export default defineComponent({ components: { cRamp, cStackedBarChart, - cMarkdownChunk, }, mixins: [brokenLinkDisabler, tooltipPositioner], props: { @@ -993,41 +984,10 @@ export default defineComponent({ return [...new Set(repo.flatMap((r) => r.commits).flatMap((c) => c.commitResults).flatMap((r) => r.tags))] .filter(Boolean) as Array; }, - - getBlurb(repo: User): string { - const link = this.getRepoLink(repo); - if (!link) { - return ''; - } - const blurb: string | undefined = this.$store.state.blurbMap[link]; - if (!blurb) { - return ''; - } - return blurb; - }, }, }); diff --git a/frontend/src/store/store.ts b/frontend/src/store/store.ts index 2781cf2e8c..c69d2a4204 100644 --- a/frontend/src/store/store.ts +++ b/frontend/src/store/store.ts @@ -18,7 +18,6 @@ export default createStore({ loadingOverlayCount: 0, loadingOverlayMessage: '', isTabActive: true, - blurbMap: {}, } as StoreState, mutations: { updateTabZoomInfo(state: StoreState, info: ZoomInfo) { @@ -83,9 +82,6 @@ export default createStore({ file.wasCodeLoaded = file.wasCodeLoaded || file.active; }); }, - setBlurbMap(state: StoreState, blurbMap: { [key: string]: string }) { - state.blurbMap = blurbMap; - }, }, actions: { // Actions are called with dispatch diff --git a/frontend/src/types/vuex.d.ts b/frontend/src/types/vuex.d.ts index abf06d15b8..cedee8c21d 100644 --- a/frontend/src/types/vuex.d.ts +++ b/frontend/src/types/vuex.d.ts @@ -47,7 +47,6 @@ interface StoreState { loadingOverlayCount: number; loadingOverlayMessage: string; isTabActive: boolean; - blurbMap: { [key: string]: string }; } declare module '@vue/runtime-core' { diff --git a/frontend/src/types/window.ts b/frontend/src/types/window.ts index dd2f1abd5e..b8a0a60524 100644 --- a/frontend/src/types/window.ts +++ b/frontend/src/types/window.ts @@ -24,7 +24,6 @@ interface Api { reportGenerationTime: string; errorMessages: { [key: string]: ErrorMessage }; names: string[]; - blurbMap: { [key: string]: string }; } | null>; loadCommits: (repoName: string) => Promise; loadAuthorship: (repoName: string) => Promise; diff --git a/frontend/src/types/zod/summary-type.ts b/frontend/src/types/zod/summary-type.ts index 316ce68f1b..4ee1635406 100644 --- a/frontend/src/types/zod/summary-type.ts +++ b/frontend/src/types/zod/summary-type.ts @@ -45,9 +45,6 @@ export const summarySchema = z.object({ isUntilDateProvided: z.boolean(), isAuthorshipAnalyzed: z.boolean().default(false), // for backwards compatability supportedDomainUrlMap: supportedDomainUrlMapSchema, - blurbs: z.object({ - urlBlurbMap: z.record(z.string(), z.string()), - }), }); // Export typescript types diff --git a/frontend/src/utils/api.ts b/frontend/src/utils/api.ts index 573180fc89..940dedffa7 100644 --- a/frontend/src/utils/api.ts +++ b/frontend/src/utils/api.ts @@ -233,14 +233,11 @@ window.api = { window.REPOS[repoName] = repo; names.push(repoName); }); - - const blurbMap: { [key: string]: string } = data.blurbs.urlBlurbMap; return { creationDate: reportGeneratedTime, reportGenerationTime, errorMessages, names, - blurbMap, }; }, diff --git a/src/main/java/reposense/RepoSense.java b/src/main/java/reposense/RepoSense.java index 36daa4d751..be54dd663b 100644 --- a/src/main/java/reposense/RepoSense.java +++ b/src/main/java/reposense/RepoSense.java @@ -10,7 +10,6 @@ import net.sourceforge.argparse4j.helper.HelpScreenException; import reposense.git.GitConfig; -import reposense.model.BlurbMap; import reposense.model.CliArguments; import reposense.model.RepoConfiguration; import reposense.model.ReportConfiguration; @@ -18,7 +17,6 @@ import reposense.parser.ArgsParser; import reposense.parser.exceptions.InvalidCsvException; import reposense.parser.exceptions.InvalidHeaderException; -import reposense.parser.exceptions.InvalidMarkdownException; import reposense.parser.exceptions.ParseException; import reposense.report.ReportGenerator; import reposense.system.LogsManager; @@ -45,7 +43,6 @@ public static void main(String[] args) { CliArguments cliArguments = ArgsParser.parse(args); List configs = null; ReportConfiguration reportConfig = new ReportConfiguration(); - BlurbMap blurbMap = new BlurbMap(); if (cliArguments.isViewModeOnly()) { ReportServer.startServer(SERVER_PORT_NUMBER, cliArguments.getReportDirectoryPath().toAbsolutePath()); @@ -54,7 +51,6 @@ public static void main(String[] args) { configs = RunConfigurationDecider.getRunConfiguration(cliArguments).getRepoConfigurations(); reportConfig = cliArguments.getReportConfiguration(); - blurbMap = cliArguments.getBlurbMap(); RepoConfiguration.setFormatsToRepoConfigs(configs, cliArguments.getFormats()); RepoConfiguration.setDatesToRepoConfigs(configs, cliArguments.getSinceDate(), cliArguments.getUntilDate()); @@ -84,9 +80,7 @@ public static void main(String[] args) { cliArguments.isSinceDateProvided(), cliArguments.isUntilDateProvided(), cliArguments.getNumCloningThreads(), cliArguments.getNumAnalysisThreads(), TimeUtil::getElapsedTime, cliArguments.getZoneId(), cliArguments.isFreshClonePerformed(), - cliArguments.isAuthorshipAnalyzed(), cliArguments.getOriginalityThreshold(), - blurbMap - ); + cliArguments.isAuthorshipAnalyzed(), cliArguments.getOriginalityThreshold()); FileUtil.zipFoldersAndFiles(reportFoldersAndFiles, cliArguments.getOutputFilePath().toAbsolutePath(), ".json"); @@ -103,8 +97,6 @@ public static void main(String[] args) { logger.log(Level.WARNING, e.getMessage(), e); } catch (HelpScreenException e) { // help message was printed by the ArgumentParser; it is safe to exit. - } catch (InvalidMarkdownException ex) { - logger.log(Level.SEVERE, ex.getMessage(), ex); } LogsManager.moveLogFileToOutputFolder(); diff --git a/src/main/java/reposense/model/BlurbMap.java b/src/main/java/reposense/model/BlurbMap.java deleted file mode 100644 index 478a3d0c1f..0000000000 --- a/src/main/java/reposense/model/BlurbMap.java +++ /dev/null @@ -1,46 +0,0 @@ -package reposense.model; - -import java.util.HashMap; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Represents the mapping between the repo URL to the associated blurb. - */ -public class BlurbMap { - @JsonProperty("urlBlurbMap") - private final Map urlBlurbMap; - - public BlurbMap() { - this.urlBlurbMap = new HashMap<>(); - } - - public Map getAllMappings() { - return new HashMap<>(this.urlBlurbMap); - } - - /** - * Adds a key-value record into the {@code BlurbMap}. - * - * @param key Key value. - * @param value Blurb value. - */ - public void withRecord(String key, String value) { - this.urlBlurbMap.put(key, value); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - - if (obj instanceof BlurbMap) { - BlurbMap bm = (BlurbMap) obj; - return bm.urlBlurbMap.equals(this.urlBlurbMap); - } - - return false; - } -} diff --git a/src/main/java/reposense/model/CliArguments.java b/src/main/java/reposense/model/CliArguments.java index 5f50e476de..d1b3564002 100644 --- a/src/main/java/reposense/model/CliArguments.java +++ b/src/main/java/reposense/model/CliArguments.java @@ -51,7 +51,6 @@ public class CliArguments { private Path groupConfigFilePath; private Path reportConfigFilePath; private ReportConfiguration reportConfiguration; - private BlurbMap blurbMap; /** * Constructs a {@code CliArguments} object without any parameters. @@ -162,10 +161,6 @@ public ReportConfiguration getReportConfiguration() { return reportConfiguration; } - public BlurbMap getBlurbMap() { - return blurbMap; - } - public boolean isViewModeOnly() { return isViewModeOnly; } @@ -216,7 +211,6 @@ public boolean equals(Object other) { && Objects.equals(this.authorConfigFilePath, otherCliArguments.authorConfigFilePath) && Objects.equals(this.groupConfigFilePath, otherCliArguments.groupConfigFilePath) && Objects.equals(this.reportConfigFilePath, otherCliArguments.reportConfigFilePath) - && Objects.equals(this.blurbMap, otherCliArguments.blurbMap) && this.isAuthorshipAnalyzed == otherCliArguments.isAuthorshipAnalyzed && Objects.equals(this.originalityThreshold, otherCliArguments.originalityThreshold); } @@ -493,16 +487,6 @@ public Builder originalityThreshold(double originalityThreshold) { return this; } - /** - * Adds the {@code blurbMap} to CliArguments. - * - * @param blurbMap The blurb map. - */ - public Builder blurbMap(BlurbMap blurbMap) { - this.cliArguments.blurbMap = blurbMap; - return this; - } - /** * Builds CliArguments. * diff --git a/src/main/java/reposense/parser/ArgsParser.java b/src/main/java/reposense/parser/ArgsParser.java index c6c3f34aa7..35d6afc3a4 100644 --- a/src/main/java/reposense/parser/ArgsParser.java +++ b/src/main/java/reposense/parser/ArgsParser.java @@ -25,11 +25,9 @@ import net.sourceforge.argparse4j.inf.MutuallyExclusiveGroup; import net.sourceforge.argparse4j.inf.Namespace; import reposense.RepoSense; -import reposense.model.BlurbMap; import reposense.model.CliArguments; import reposense.model.FileType; import reposense.model.ReportConfiguration; -import reposense.parser.exceptions.InvalidMarkdownException; import reposense.parser.exceptions.ParseException; import reposense.parser.types.AlphanumericArgumentType; import reposense.parser.types.AnalysisThreadsArgumentType; @@ -93,7 +91,6 @@ public class ArgsParser { "Config path not provided, using the config folder as default."; private static final String MESSAGE_INVALID_CONFIG_PATH = "%s is malformed."; private static final String MESSAGE_INVALID_CONFIG_JSON = "%s Ignoring the report config provided."; - private static final String MESSAGE_INVALID_MARKDOWN_BLURBS = "%s Ignoring the blurb file provided."; private static final String MESSAGE_SINCE_D1_WITH_PERIOD = "You may be using --since d1 with the --period flag. " + "This may result in an incorrect date range being analysed."; private static final String MESSAGE_SINCE_DATE_LATER_THAN_UNTIL_DATE = @@ -349,7 +346,6 @@ public static CliArguments parse(String[] args) throws HelpScreenException, Pars } addReportConfigToBuilder(cliArgumentsBuilder, results); - addBlurbMapToBuilder(cliArgumentsBuilder, results); addAnalysisDatesToBuilder(cliArgumentsBuilder, results); boolean isViewModeOnly = reportFolderPath != null @@ -401,31 +397,6 @@ private static void addReportConfigToBuilder(CliArguments.Builder builder, Names builder.reportConfiguration(reportConfig); } - /** - * Adds the blurbMap field to the given {@code builder}. - * - * @param builder Builder to be supplied with the reportConfig field. - * @param results Parsed results of the user-supplied CLI arguments. - */ - private static void addBlurbMapToBuilder(CliArguments.Builder builder, Namespace results) { - BlurbMap blurbMap = new BlurbMap(); - Path configFolderPath = results.get(CONFIG_FLAGS[0]); - - // Blurbs are parsed regardless - Path blurbConfigPath = configFolderPath.resolve(BlurbMarkdownParser.DEFAULT_BLURB_FILENAME); - - try { - blurbMap = new BlurbMarkdownParser(blurbConfigPath).parse(); - } catch (InvalidMarkdownException ex) { - logger.warning(String.format(MESSAGE_INVALID_MARKDOWN_BLURBS, ex.getMessage())); - } catch (IOException ioe) { - // IOException thrown as blurbs.md is not found. - // Ignore exception as the file is optional. - } - - builder.blurbMap(blurbMap); - } - /** * Adds the sinceDate and untilDate fields for analysis to the given {@code builder}. * diff --git a/src/main/java/reposense/parser/BlurbMarkdownParser.java b/src/main/java/reposense/parser/BlurbMarkdownParser.java deleted file mode 100644 index 8c3e5a0f67..0000000000 --- a/src/main/java/reposense/parser/BlurbMarkdownParser.java +++ /dev/null @@ -1,151 +0,0 @@ -package reposense.parser; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import java.util.regex.Pattern; - -import reposense.model.BlurbMap; -import reposense.parser.exceptions.InvalidMarkdownException; - -/** - * Parses the Markdown file and retrieves the mappings from URLs to blurbs from the blurbs - * configuration file. - */ -public class BlurbMarkdownParser extends MarkdownParser { - public static final Pattern DELIMITER = Pattern.compile("(.*)"); - public static final String DEFAULT_BLURB_FILENAME = "blurbs.md"; - - private static final class UrlRecord { - private final String url; - private final int nextPosition; - - public UrlRecord(String url, int nextPosition) { - this.url = url; - this.nextPosition = nextPosition; - } - - public String getUrl() { - return url; - } - - public int getNextPosition() { - return nextPosition; - } - } - - private static final class BlurbRecord { - private final List blurb; - private final int nextPosition; - - public BlurbRecord(List blurb, int nextPosition) { - this.blurb = blurb; - this.nextPosition = nextPosition; - } - - public List getBlurb() { - return blurb; - } - - public int getNextPosition() { - return nextPosition; - } - } - - public BlurbMarkdownParser(Path markdownPath) throws FileNotFoundException { - super(markdownPath); - } - - /** - * Parses the markdown file containing the url to blurb mapping and returns a - * {@code BlurbMap} containing the mappings between the url and blurbs. - * - * @return {@code BlurbMap} object. - * @throws IOException if there are any issues opening or parsing the {@code blurbs.md} file. - */ - @Override - public BlurbMap parse() throws IOException, InvalidMarkdownException { - logger.log(Level.INFO, "Parsing Blurbs..."); - // read all the lines first - List mdLines = Files.readAllLines(this.markdownPath); - - // if the file is empty, then we throw the exception and let the adder handle - if (mdLines.isEmpty()) { - throw new InvalidMarkdownException("Empty blurbs.md file"); - } - - // prepare the blurb map - BlurbMap blurbMap = new BlurbMap(); - - // define temporary local variables to track blurbs - String url = ""; - StringBuilder blurb = new StringBuilder(); - int counter = 0; - - while (counter < mdLines.size()) { - // extract the url record first - // this is guaranteed to be in the first line or else we fail - UrlRecord urlRecord = this.getUrlRecord(mdLines, counter); - url = urlRecord.getUrl(); - counter = urlRecord.getNextPosition(); - - // then extract the blurb record next - // we extract until the delimiter is found and then we will stop - BlurbRecord blurbRecord = this.getBlurbRecord(mdLines, counter); - List blurbExtracted = blurbRecord.getBlurb(); - for (String string : blurbExtracted) { - blurb.append(string); - } - counter = blurbRecord.getNextPosition(); - - // add the recorded entry into the BlurbMap - // strip the trailing /n - blurbMap.withRecord(url, blurb.toString().stripTrailing()); - blurb.setLength(0); - } - - // return the built BlurbMap instance - logger.log(Level.INFO, "Blurbs parsed successfully!"); - return blurbMap; - } - - private UrlRecord getUrlRecord(List lines, int position) throws InvalidMarkdownException { - // checks if url is valid - // adapted from https://www.baeldung.com/java-validate-url - try { - String url = lines.get(position).strip(); - new URL(url).toURI(); - return new UrlRecord(lines.get(position), position + 1); - } catch (MalformedURLException | URISyntaxException ex) { - throw new InvalidMarkdownException("URL provided is not valid!"); - } - } - - private BlurbRecord getBlurbRecord(List lines, int position) { - int lineSize = lines.size(); - int posCounter = position; - List blurbs = new ArrayList<>(); - - while (posCounter < lineSize) { - String currLine = lines.get(posCounter); - - if (BlurbMarkdownParser.DELIMITER.matcher(currLine).matches()) { - break; - } else { - currLine += "\n"; - blurbs.add(currLine); - } - - posCounter++; - } - - return new BlurbRecord(blurbs, posCounter + 1); - } -} diff --git a/src/main/java/reposense/parser/MarkdownParser.java b/src/main/java/reposense/parser/MarkdownParser.java deleted file mode 100644 index 93ca3cb95d..0000000000 --- a/src/main/java/reposense/parser/MarkdownParser.java +++ /dev/null @@ -1,32 +0,0 @@ -package reposense.parser; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.logging.Logger; - -import reposense.parser.exceptions.InvalidMarkdownException; -import reposense.system.LogsManager; - -/** - * Parses Markdown file according to the "" tag. - * - * @param Generic Type {@code T}. - */ -public abstract class MarkdownParser { - protected static final Logger logger = LogsManager.getLogger(MarkdownParser.class); - - protected Path markdownPath; - - public MarkdownParser(Path markdownPath) throws FileNotFoundException { - if (markdownPath == null || !Files.exists(markdownPath)) { - throw new FileNotFoundException("Markdown file does not exist at the given path.\n" - + "Use '-help' to list all the available subcommands and some concept guides."); - } - - this.markdownPath = markdownPath; - } - - public abstract T parse() throws IOException, InvalidMarkdownException; -} diff --git a/src/main/java/reposense/parser/exceptions/InvalidMarkdownException.java b/src/main/java/reposense/parser/exceptions/InvalidMarkdownException.java deleted file mode 100644 index fc6b2fd71a..0000000000 --- a/src/main/java/reposense/parser/exceptions/InvalidMarkdownException.java +++ /dev/null @@ -1,10 +0,0 @@ -package reposense.parser.exceptions; - -/** - * Represents the error thrown when Markdown files cannot be parsed. - */ -public class InvalidMarkdownException extends Exception { - public InvalidMarkdownException(String message) { - super(message); - } -} diff --git a/src/main/java/reposense/report/ReportGenerator.java b/src/main/java/reposense/report/ReportGenerator.java index ab0b19ec6e..fd1f9744bd 100644 --- a/src/main/java/reposense/report/ReportGenerator.java +++ b/src/main/java/reposense/report/ReportGenerator.java @@ -41,14 +41,12 @@ import reposense.git.exception.GitBranchException; import reposense.git.exception.GitCloneException; import reposense.model.Author; -import reposense.model.BlurbMap; import reposense.model.CommitHash; import reposense.model.RepoConfiguration; import reposense.model.RepoLocation; import reposense.model.ReportConfiguration; import reposense.model.StandaloneConfig; import reposense.parser.StandaloneConfigJsonParser; -import reposense.parser.exceptions.InvalidMarkdownException; import reposense.report.exception.NoAuthorsWithCommitsFoundException; import reposense.system.LogsManager; import reposense.util.FileUtil; @@ -114,17 +112,14 @@ public class ReportGenerator { * @param shouldFreshClone The boolean variable for whether to clone a repo again during tests. * @param shouldAnalyzeAuthorship The boolean variable for whether to further analyze authorship. * @param originalityThreshold The double variable for originality threshold in analyze authorship. - * @param blurbMap The {@code BlurbMap}. * @return the list of file paths that were generated. * @throws IOException if templateZip.zip does not exist in jar file. - * @throws InvalidMarkdownException if the blurb markdown file cannot be parsed properly. */ public List generateReposReport(List configs, String outputPath, String assetsPath, ReportConfiguration reportConfig, String generationDate, LocalDateTime cliSinceDate, LocalDateTime untilDate, boolean isSinceDateProvided, boolean isUntilDateProvided, int numCloningThreads, int numAnalysisThreads, Supplier reportGenerationTimeProvider, ZoneId zoneId, - boolean shouldFreshClone, boolean shouldAnalyzeAuthorship, double originalityThreshold, BlurbMap blurbMap) - throws IOException, InvalidMarkdownException { + boolean shouldFreshClone, boolean shouldAnalyzeAuthorship, double originalityThreshold) throws IOException { prepareTemplateFile(outputPath); if (Files.exists(Paths.get(assetsPath))) { FileUtil.copyDirectoryContents(assetsPath, outputPath, assetsFilesWhiteList); @@ -143,7 +138,7 @@ public List generateReposReport(List configs, String ou new SummaryJson(configs, reportConfig, generationDate, reportSinceDate, untilDate, isSinceDateProvided, isUntilDateProvided, RepoSense.getVersion(), ErrorSummary.getInstance().getErrorSet(), - reportGenerationTimeProvider.get(), zoneId, shouldAnalyzeAuthorship, blurbMap), + reportGenerationTimeProvider.get(), zoneId, shouldAnalyzeAuthorship), getSummaryResultPath(outputPath)); summaryPath.ifPresent(reportFoldersAndFiles::add); diff --git a/src/main/java/reposense/report/SummaryJson.java b/src/main/java/reposense/report/SummaryJson.java index 1e65acad2b..f709fb0998 100644 --- a/src/main/java/reposense/report/SummaryJson.java +++ b/src/main/java/reposense/report/SummaryJson.java @@ -6,7 +6,6 @@ import java.util.Map; import java.util.Set; -import reposense.model.BlurbMap; import reposense.model.RepoConfiguration; import reposense.model.ReportConfiguration; import reposense.model.SupportedDomainUrlMap; @@ -30,13 +29,11 @@ public class SummaryJson { private final boolean isUntilDateProvided; private final Map> supportedDomainUrlMap; private final boolean isAuthorshipAnalyzed; - private final BlurbMap blurbs; public SummaryJson(List repos, ReportConfiguration reportConfig, String reportGeneratedTime, - LocalDateTime sinceDate, LocalDateTime untilDate, boolean isSinceDateProvided, - boolean isUntilDateProvided, String repoSenseVersion, Set> errorSet, - String reportGenerationTime, ZoneId zoneId, - boolean isAuthorshipAnalyzed, BlurbMap blurbs) { + LocalDateTime sinceDate, LocalDateTime untilDate, boolean isSinceDateProvided, boolean isUntilDateProvided, + String repoSenseVersion, Set> errorSet, String reportGenerationTime, ZoneId zoneId, + boolean isAuthorshipAnalyzed) { this.repos = repos; this.reportGeneratedTime = reportGeneratedTime; this.reportGenerationTime = reportGenerationTime; @@ -50,6 +47,5 @@ public SummaryJson(List repos, ReportConfiguration reportConf this.zoneId = zoneId; this.supportedDomainUrlMap = SupportedDomainUrlMap.getDefaultDomainUrlMap(); this.isAuthorshipAnalyzed = isAuthorshipAnalyzed; - this.blurbs = blurbs; } } diff --git a/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDate/expected/summary.json b/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDate/expected/summary.json index f17b82ee29..c809a19ae0 100644 --- a/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDate/expected/summary.json +++ b/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDate/expected/summary.json @@ -1,91 +1 @@ -{ - "reportGeneratedTime": "Tue Jul 24 17:45:15 SGT 2018", - "reportGenerationTime": "15 second(s)", - "zoneId": "Asia/Singapore", - "reportTitle": "RepoSense Report Test Title", - "repos": [ - { - "location": { - "location": "https://github.com/reposense/testrepo-Alpha.git", - "repoName": "testrepo-Alpha", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Alpha[master]", - "outputFolderName": "reposense_testrepo-Alpha_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Beta.git", - "repoName": "testrepo-Beta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Beta[master]", - "outputFolderName": "reposense_testrepo-Beta_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Charlie.git", - "repoName": "testrepo-Charlie", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Charlie[master]", - "outputFolderName": "reposense_testrepo-Charlie_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Delta.git", - "repoName": "testrepo-Delta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Delta[master]", - "outputFolderName": "reposense_testrepo-Delta_master" - } - ], - "errorSet": [ - { - "repoName": "ttps://github.com/reposense/testrepo-Beta.git", - "errorMessage": "ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL." - }, - { - "repoName": "reposense/testrepo-Delta[nonExistentBranch]", - "errorMessage": "Branch \"nonExistentBranch\" does not exist." - } - ], - "sinceDate": "2017-10-01", - "untilDate": "2017-11-01", - "isSinceDateProvided": false, - "isUntilDateProvided": true, - "supportedDomainUrlMap": { - "NOT_RECOGNIZED": { - "BRANCH": "", - "REPO_URL": "UNSUPPORTED", - "BASE_URL": "UNSUPPORTED", - "HISTORY_PATH": "", - "COMMIT_PATH": "", - "BLAME_PATH": "" - }, - "github": { - "BRANCH": "tree/$BRANCH", - "REPO_URL": "https://github.com/$ORGANIZATION/$REPO_NAME/", - "BASE_URL": "https://github.com/", - "HISTORY_PATH": "commits/$BRANCH/$FILE_PATH", - "COMMIT_PATH": "commit/$COMMIT_HASH", - "BLAME_PATH": "blame/$BRANCH/$FILE_PATH" - } - }, - "blurbs": { - "urlBlurbMap": { - "https://www.github.com/user/repo/branch": "first blurb", - "https://www.github.com/user/repo/branch2": "## **second** blurb\n\n![link](link) to repository\n\nthis is what i have done for my cs2103t project", - "https://www.github.com/user/repo/branch3": "*third blurb*\n\nthird blurb with HTML content" - } - } -} +{"reportGeneratedTime":"Tue Jul 24 17:45:15 SGT 2018","reportGenerationTime":"15 second(s)","zoneId":"Asia/Singapore","reportTitle":"RepoSense Report Test Title","repos":[{"location":{"location":"https://github.com/reposense/testrepo-Alpha.git","repoName":"testrepo-Alpha","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Alpha[master]","outputFolderName":"reposense_testrepo-Alpha_master"},{"location":{"location":"https://github.com/reposense/testrepo-Beta.git","repoName":"testrepo-Beta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Beta[master]","outputFolderName":"reposense_testrepo-Beta_master"},{"location":{"location":"https://github.com/reposense/testrepo-Charlie.git","repoName":"testrepo-Charlie","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Charlie[master]","outputFolderName":"reposense_testrepo-Charlie_master"},{"location":{"location":"https://github.com/reposense/testrepo-Delta.git","repoName":"testrepo-Delta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Delta[master]","outputFolderName":"reposense_testrepo-Delta_master"}],"errorSet":[{"repoName":"ttps://github.com/reposense/testrepo-Beta.git","errorMessage":"ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL."},{"repoName":"reposense/testrepo-Delta[nonExistentBranch]","errorMessage":"Branch \"nonExistentBranch\" does not exist."}],"sinceDate":"2017-10-01","untilDate":"2017-11-01","isSinceDateProvided":false,"isUntilDateProvided":true,"supportedDomainUrlMap":{"NOT_RECOGNIZED":{"BRANCH":"","REPO_URL":"UNSUPPORTED","BASE_URL":"UNSUPPORTED","HISTORY_PATH":"","COMMIT_PATH":"","BLAME_PATH":""},"github":{"BRANCH":"tree/$BRANCH","REPO_URL":"https://github.com/$ORGANIZATION/$REPO_NAME/","BASE_URL":"https://github.com/","HISTORY_PATH":"commits/$BRANCH/$FILE_PATH","COMMIT_PATH":"commit/$COMMIT_HASH","BLAME_PATH":"blame/$BRANCH/$FILE_PATH"}}} diff --git a/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDateFindPreviousAuthors/expected/summary.json b/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDateFindPreviousAuthors/expected/summary.json index f17b82ee29..c809a19ae0 100644 --- a/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDateFindPreviousAuthors/expected/summary.json +++ b/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDateFindPreviousAuthors/expected/summary.json @@ -1,91 +1 @@ -{ - "reportGeneratedTime": "Tue Jul 24 17:45:15 SGT 2018", - "reportGenerationTime": "15 second(s)", - "zoneId": "Asia/Singapore", - "reportTitle": "RepoSense Report Test Title", - "repos": [ - { - "location": { - "location": "https://github.com/reposense/testrepo-Alpha.git", - "repoName": "testrepo-Alpha", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Alpha[master]", - "outputFolderName": "reposense_testrepo-Alpha_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Beta.git", - "repoName": "testrepo-Beta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Beta[master]", - "outputFolderName": "reposense_testrepo-Beta_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Charlie.git", - "repoName": "testrepo-Charlie", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Charlie[master]", - "outputFolderName": "reposense_testrepo-Charlie_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Delta.git", - "repoName": "testrepo-Delta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Delta[master]", - "outputFolderName": "reposense_testrepo-Delta_master" - } - ], - "errorSet": [ - { - "repoName": "ttps://github.com/reposense/testrepo-Beta.git", - "errorMessage": "ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL." - }, - { - "repoName": "reposense/testrepo-Delta[nonExistentBranch]", - "errorMessage": "Branch \"nonExistentBranch\" does not exist." - } - ], - "sinceDate": "2017-10-01", - "untilDate": "2017-11-01", - "isSinceDateProvided": false, - "isUntilDateProvided": true, - "supportedDomainUrlMap": { - "NOT_RECOGNIZED": { - "BRANCH": "", - "REPO_URL": "UNSUPPORTED", - "BASE_URL": "UNSUPPORTED", - "HISTORY_PATH": "", - "COMMIT_PATH": "", - "BLAME_PATH": "" - }, - "github": { - "BRANCH": "tree/$BRANCH", - "REPO_URL": "https://github.com/$ORGANIZATION/$REPO_NAME/", - "BASE_URL": "https://github.com/", - "HISTORY_PATH": "commits/$BRANCH/$FILE_PATH", - "COMMIT_PATH": "commit/$COMMIT_HASH", - "BLAME_PATH": "blame/$BRANCH/$FILE_PATH" - } - }, - "blurbs": { - "urlBlurbMap": { - "https://www.github.com/user/repo/branch": "first blurb", - "https://www.github.com/user/repo/branch2": "## **second** blurb\n\n![link](link) to repository\n\nthis is what i have done for my cs2103t project", - "https://www.github.com/user/repo/branch3": "*third blurb*\n\nthird blurb with HTML content" - } - } -} +{"reportGeneratedTime":"Tue Jul 24 17:45:15 SGT 2018","reportGenerationTime":"15 second(s)","zoneId":"Asia/Singapore","reportTitle":"RepoSense Report Test Title","repos":[{"location":{"location":"https://github.com/reposense/testrepo-Alpha.git","repoName":"testrepo-Alpha","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Alpha[master]","outputFolderName":"reposense_testrepo-Alpha_master"},{"location":{"location":"https://github.com/reposense/testrepo-Beta.git","repoName":"testrepo-Beta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Beta[master]","outputFolderName":"reposense_testrepo-Beta_master"},{"location":{"location":"https://github.com/reposense/testrepo-Charlie.git","repoName":"testrepo-Charlie","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Charlie[master]","outputFolderName":"reposense_testrepo-Charlie_master"},{"location":{"location":"https://github.com/reposense/testrepo-Delta.git","repoName":"testrepo-Delta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Delta[master]","outputFolderName":"reposense_testrepo-Delta_master"}],"errorSet":[{"repoName":"ttps://github.com/reposense/testrepo-Beta.git","errorMessage":"ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL."},{"repoName":"reposense/testrepo-Delta[nonExistentBranch]","errorMessage":"Branch \"nonExistentBranch\" does not exist."}],"sinceDate":"2017-10-01","untilDate":"2017-11-01","isSinceDateProvided":false,"isUntilDateProvided":true,"supportedDomainUrlMap":{"NOT_RECOGNIZED":{"BRANCH":"","REPO_URL":"UNSUPPORTED","BASE_URL":"UNSUPPORTED","HISTORY_PATH":"","COMMIT_PATH":"","BLAME_PATH":""},"github":{"BRANCH":"tree/$BRANCH","REPO_URL":"https://github.com/$ORGANIZATION/$REPO_NAME/","BASE_URL":"https://github.com/","HISTORY_PATH":"commits/$BRANCH/$FILE_PATH","COMMIT_PATH":"commit/$COMMIT_HASH","BLAME_PATH":"blame/$BRANCH/$FILE_PATH"}}} diff --git a/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDateWithShallowCloning/expected/summary.json b/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDateWithShallowCloning/expected/summary.json index f17b82ee29..c809a19ae0 100644 --- a/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDateWithShallowCloning/expected/summary.json +++ b/src/systemtest/resources/ConfigSystemTest/30daysFromUntilDateWithShallowCloning/expected/summary.json @@ -1,91 +1 @@ -{ - "reportGeneratedTime": "Tue Jul 24 17:45:15 SGT 2018", - "reportGenerationTime": "15 second(s)", - "zoneId": "Asia/Singapore", - "reportTitle": "RepoSense Report Test Title", - "repos": [ - { - "location": { - "location": "https://github.com/reposense/testrepo-Alpha.git", - "repoName": "testrepo-Alpha", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Alpha[master]", - "outputFolderName": "reposense_testrepo-Alpha_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Beta.git", - "repoName": "testrepo-Beta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Beta[master]", - "outputFolderName": "reposense_testrepo-Beta_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Charlie.git", - "repoName": "testrepo-Charlie", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Charlie[master]", - "outputFolderName": "reposense_testrepo-Charlie_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Delta.git", - "repoName": "testrepo-Delta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Delta[master]", - "outputFolderName": "reposense_testrepo-Delta_master" - } - ], - "errorSet": [ - { - "repoName": "ttps://github.com/reposense/testrepo-Beta.git", - "errorMessage": "ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL." - }, - { - "repoName": "reposense/testrepo-Delta[nonExistentBranch]", - "errorMessage": "Branch \"nonExistentBranch\" does not exist." - } - ], - "sinceDate": "2017-10-01", - "untilDate": "2017-11-01", - "isSinceDateProvided": false, - "isUntilDateProvided": true, - "supportedDomainUrlMap": { - "NOT_RECOGNIZED": { - "BRANCH": "", - "REPO_URL": "UNSUPPORTED", - "BASE_URL": "UNSUPPORTED", - "HISTORY_PATH": "", - "COMMIT_PATH": "", - "BLAME_PATH": "" - }, - "github": { - "BRANCH": "tree/$BRANCH", - "REPO_URL": "https://github.com/$ORGANIZATION/$REPO_NAME/", - "BASE_URL": "https://github.com/", - "HISTORY_PATH": "commits/$BRANCH/$FILE_PATH", - "COMMIT_PATH": "commit/$COMMIT_HASH", - "BLAME_PATH": "blame/$BRANCH/$FILE_PATH" - } - }, - "blurbs": { - "urlBlurbMap": { - "https://www.github.com/user/repo/branch": "first blurb", - "https://www.github.com/user/repo/branch2": "## **second** blurb\n\n![link](link) to repository\n\nthis is what i have done for my cs2103t project", - "https://www.github.com/user/repo/branch3": "*third blurb*\n\nthird blurb with HTML content" - } - } -} +{"reportGeneratedTime":"Tue Jul 24 17:45:15 SGT 2018","reportGenerationTime":"15 second(s)","zoneId":"Asia/Singapore","reportTitle":"RepoSense Report Test Title","repos":[{"location":{"location":"https://github.com/reposense/testrepo-Alpha.git","repoName":"testrepo-Alpha","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Alpha[master]","outputFolderName":"reposense_testrepo-Alpha_master"},{"location":{"location":"https://github.com/reposense/testrepo-Beta.git","repoName":"testrepo-Beta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Beta[master]","outputFolderName":"reposense_testrepo-Beta_master"},{"location":{"location":"https://github.com/reposense/testrepo-Charlie.git","repoName":"testrepo-Charlie","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Charlie[master]","outputFolderName":"reposense_testrepo-Charlie_master"},{"location":{"location":"https://github.com/reposense/testrepo-Delta.git","repoName":"testrepo-Delta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Delta[master]","outputFolderName":"reposense_testrepo-Delta_master"}],"errorSet":[{"repoName":"ttps://github.com/reposense/testrepo-Beta.git","errorMessage":"ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL."},{"repoName":"reposense/testrepo-Delta[nonExistentBranch]","errorMessage":"Branch \"nonExistentBranch\" does not exist."}],"sinceDate":"2017-10-01","untilDate":"2017-11-01","isSinceDateProvided":false,"isUntilDateProvided":true,"supportedDomainUrlMap":{"NOT_RECOGNIZED":{"BRANCH":"","REPO_URL":"UNSUPPORTED","BASE_URL":"UNSUPPORTED","HISTORY_PATH":"","COMMIT_PATH":"","BLAME_PATH":""},"github":{"BRANCH":"tree/$BRANCH","REPO_URL":"https://github.com/$ORGANIZATION/$REPO_NAME/","BASE_URL":"https://github.com/","HISTORY_PATH":"commits/$BRANCH/$FILE_PATH","COMMIT_PATH":"commit/$COMMIT_HASH","BLAME_PATH":"blame/$BRANCH/$FILE_PATH"}}} diff --git a/src/systemtest/resources/ConfigSystemTest/blurbs.md b/src/systemtest/resources/ConfigSystemTest/blurbs.md deleted file mode 100644 index e8a130cc46..0000000000 --- a/src/systemtest/resources/ConfigSystemTest/blurbs.md +++ /dev/null @@ -1,14 +0,0 @@ -https://www.github.com/user/repo/branch -first blurb - -https://www.github.com/user/repo/branch2 -## **second** blurb - -![link](link) to repository - -this is what i have done for my cs2103t project - -https://www.github.com/user/repo/branch3 -*third blurb* - -third blurb with HTML content diff --git a/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRange/expected/summary.json b/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRange/expected/summary.json index f274f98e7d..f0d69e7d5b 100644 --- a/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRange/expected/summary.json +++ b/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRange/expected/summary.json @@ -1,91 +1 @@ -{ - "reportGeneratedTime": "Tue Jul 24 17:45:15 SGT 2018", - "reportGenerationTime": "15 second(s)", - "zoneId": "Asia/Singapore", - "reportTitle": "RepoSense Report Test Title", - "repos": [ - { - "location": { - "location": "https://github.com/reposense/testrepo-Alpha.git", - "repoName": "testrepo-Alpha", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Alpha[master]", - "outputFolderName": "reposense_testrepo-Alpha_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Beta.git", - "repoName": "testrepo-Beta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Beta[master]", - "outputFolderName": "reposense_testrepo-Beta_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Charlie.git", - "repoName": "testrepo-Charlie", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Charlie[master]", - "outputFolderName": "reposense_testrepo-Charlie_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Delta.git", - "repoName": "testrepo-Delta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Delta[master]", - "outputFolderName": "reposense_testrepo-Delta_master" - } - ], - "errorSet": [ - { - "repoName": "ttps://github.com/reposense/testrepo-Beta.git", - "errorMessage": "ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL." - }, - { - "repoName": "reposense/testrepo-Delta[nonExistentBranch]", - "errorMessage": "Branch \"nonExistentBranch\" does not exist." - } - ], - "sinceDate": "2017-09-30", - "untilDate": "2019-03-02", - "isSinceDateProvided": true, - "isUntilDateProvided": true, - "supportedDomainUrlMap": { - "NOT_RECOGNIZED": { - "BRANCH": "", - "REPO_URL": "UNSUPPORTED", - "BASE_URL": "UNSUPPORTED", - "HISTORY_PATH": "", - "COMMIT_PATH": "", - "BLAME_PATH": "" - }, - "github": { - "BRANCH": "tree/$BRANCH", - "REPO_URL": "https://github.com/$ORGANIZATION/$REPO_NAME/", - "BASE_URL": "https://github.com/", - "HISTORY_PATH": "commits/$BRANCH/$FILE_PATH", - "COMMIT_PATH": "commit/$COMMIT_HASH", - "BLAME_PATH": "blame/$BRANCH/$FILE_PATH" - } - }, - "blurbs": { - "urlBlurbMap": { - "https://www.github.com/user/repo/branch": "first blurb", - "https://www.github.com/user/repo/branch2": "## **second** blurb\n\n![link](link) to repository\n\nthis is what i have done for my cs2103t project", - "https://www.github.com/user/repo/branch3": "*third blurb*\n\nthird blurb with HTML content" - } - } -} +{"reportGeneratedTime":"Tue Jul 24 17:45:15 SGT 2018","reportGenerationTime":"15 second(s)","zoneId":"Asia/Singapore","reportTitle":"RepoSense Report Test Title","repos":[{"location":{"location":"https://github.com/reposense/testrepo-Alpha.git","repoName":"testrepo-Alpha","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Alpha[master]","outputFolderName":"reposense_testrepo-Alpha_master"},{"location":{"location":"https://github.com/reposense/testrepo-Beta.git","repoName":"testrepo-Beta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Beta[master]","outputFolderName":"reposense_testrepo-Beta_master"},{"location":{"location":"https://github.com/reposense/testrepo-Charlie.git","repoName":"testrepo-Charlie","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Charlie[master]","outputFolderName":"reposense_testrepo-Charlie_master"},{"location":{"location":"https://github.com/reposense/testrepo-Delta.git","repoName":"testrepo-Delta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Delta[master]","outputFolderName":"reposense_testrepo-Delta_master"}],"errorSet":[{"repoName":"ttps://github.com/reposense/testrepo-Beta.git","errorMessage":"ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL."},{"repoName":"reposense/testrepo-Delta[nonExistentBranch]","errorMessage":"Branch \"nonExistentBranch\" does not exist."}],"sinceDate":"2017-09-30","untilDate":"2019-03-02","isSinceDateProvided":true,"isUntilDateProvided":true,"supportedDomainUrlMap":{"NOT_RECOGNIZED":{"BRANCH":"","REPO_URL":"UNSUPPORTED","BASE_URL":"UNSUPPORTED","HISTORY_PATH":"","COMMIT_PATH":"","BLAME_PATH":""},"github":{"BRANCH":"tree/$BRANCH","REPO_URL":"https://github.com/$ORGANIZATION/$REPO_NAME/","BASE_URL":"https://github.com/","HISTORY_PATH":"commits/$BRANCH/$FILE_PATH","COMMIT_PATH":"commit/$COMMIT_HASH","BLAME_PATH":"blame/$BRANCH/$FILE_PATH"}}} diff --git a/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRangeFindPreviousAuthors/expected/summary.json b/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRangeFindPreviousAuthors/expected/summary.json index f274f98e7d..f0d69e7d5b 100644 --- a/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRangeFindPreviousAuthors/expected/summary.json +++ b/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRangeFindPreviousAuthors/expected/summary.json @@ -1,91 +1 @@ -{ - "reportGeneratedTime": "Tue Jul 24 17:45:15 SGT 2018", - "reportGenerationTime": "15 second(s)", - "zoneId": "Asia/Singapore", - "reportTitle": "RepoSense Report Test Title", - "repos": [ - { - "location": { - "location": "https://github.com/reposense/testrepo-Alpha.git", - "repoName": "testrepo-Alpha", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Alpha[master]", - "outputFolderName": "reposense_testrepo-Alpha_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Beta.git", - "repoName": "testrepo-Beta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Beta[master]", - "outputFolderName": "reposense_testrepo-Beta_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Charlie.git", - "repoName": "testrepo-Charlie", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Charlie[master]", - "outputFolderName": "reposense_testrepo-Charlie_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Delta.git", - "repoName": "testrepo-Delta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Delta[master]", - "outputFolderName": "reposense_testrepo-Delta_master" - } - ], - "errorSet": [ - { - "repoName": "ttps://github.com/reposense/testrepo-Beta.git", - "errorMessage": "ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL." - }, - { - "repoName": "reposense/testrepo-Delta[nonExistentBranch]", - "errorMessage": "Branch \"nonExistentBranch\" does not exist." - } - ], - "sinceDate": "2017-09-30", - "untilDate": "2019-03-02", - "isSinceDateProvided": true, - "isUntilDateProvided": true, - "supportedDomainUrlMap": { - "NOT_RECOGNIZED": { - "BRANCH": "", - "REPO_URL": "UNSUPPORTED", - "BASE_URL": "UNSUPPORTED", - "HISTORY_PATH": "", - "COMMIT_PATH": "", - "BLAME_PATH": "" - }, - "github": { - "BRANCH": "tree/$BRANCH", - "REPO_URL": "https://github.com/$ORGANIZATION/$REPO_NAME/", - "BASE_URL": "https://github.com/", - "HISTORY_PATH": "commits/$BRANCH/$FILE_PATH", - "COMMIT_PATH": "commit/$COMMIT_HASH", - "BLAME_PATH": "blame/$BRANCH/$FILE_PATH" - } - }, - "blurbs": { - "urlBlurbMap": { - "https://www.github.com/user/repo/branch": "first blurb", - "https://www.github.com/user/repo/branch2": "## **second** blurb\n\n![link](link) to repository\n\nthis is what i have done for my cs2103t project", - "https://www.github.com/user/repo/branch3": "*third blurb*\n\nthird blurb with HTML content" - } - } -} +{"reportGeneratedTime":"Tue Jul 24 17:45:15 SGT 2018","reportGenerationTime":"15 second(s)","zoneId":"Asia/Singapore","reportTitle":"RepoSense Report Test Title","repos":[{"location":{"location":"https://github.com/reposense/testrepo-Alpha.git","repoName":"testrepo-Alpha","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Alpha[master]","outputFolderName":"reposense_testrepo-Alpha_master"},{"location":{"location":"https://github.com/reposense/testrepo-Beta.git","repoName":"testrepo-Beta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Beta[master]","outputFolderName":"reposense_testrepo-Beta_master"},{"location":{"location":"https://github.com/reposense/testrepo-Charlie.git","repoName":"testrepo-Charlie","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Charlie[master]","outputFolderName":"reposense_testrepo-Charlie_master"},{"location":{"location":"https://github.com/reposense/testrepo-Delta.git","repoName":"testrepo-Delta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Delta[master]","outputFolderName":"reposense_testrepo-Delta_master"}],"errorSet":[{"repoName":"ttps://github.com/reposense/testrepo-Beta.git","errorMessage":"ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL."},{"repoName":"reposense/testrepo-Delta[nonExistentBranch]","errorMessage":"Branch \"nonExistentBranch\" does not exist."}],"sinceDate":"2017-09-30","untilDate":"2019-03-02","isSinceDateProvided":true,"isUntilDateProvided":true,"supportedDomainUrlMap":{"NOT_RECOGNIZED":{"BRANCH":"","REPO_URL":"UNSUPPORTED","BASE_URL":"UNSUPPORTED","HISTORY_PATH":"","COMMIT_PATH":"","BLAME_PATH":""},"github":{"BRANCH":"tree/$BRANCH","REPO_URL":"https://github.com/$ORGANIZATION/$REPO_NAME/","BASE_URL":"https://github.com/","HISTORY_PATH":"commits/$BRANCH/$FILE_PATH","COMMIT_PATH":"commit/$COMMIT_HASH","BLAME_PATH":"blame/$BRANCH/$FILE_PATH"}}} diff --git a/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRangeWithShallowCloning/expected/summary.json b/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRangeWithShallowCloning/expected/summary.json index f274f98e7d..f0d69e7d5b 100644 --- a/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRangeWithShallowCloning/expected/summary.json +++ b/src/systemtest/resources/ConfigSystemTest/sinceBeginningDateRangeWithShallowCloning/expected/summary.json @@ -1,91 +1 @@ -{ - "reportGeneratedTime": "Tue Jul 24 17:45:15 SGT 2018", - "reportGenerationTime": "15 second(s)", - "zoneId": "Asia/Singapore", - "reportTitle": "RepoSense Report Test Title", - "repos": [ - { - "location": { - "location": "https://github.com/reposense/testrepo-Alpha.git", - "repoName": "testrepo-Alpha", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Alpha[master]", - "outputFolderName": "reposense_testrepo-Alpha_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Beta.git", - "repoName": "testrepo-Beta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Beta[master]", - "outputFolderName": "reposense_testrepo-Beta_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Charlie.git", - "repoName": "testrepo-Charlie", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Charlie[master]", - "outputFolderName": "reposense_testrepo-Charlie_master" - }, - { - "location": { - "location": "https://github.com/reposense/testrepo-Delta.git", - "repoName": "testrepo-Delta", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "reposense/testrepo-Delta[master]", - "outputFolderName": "reposense_testrepo-Delta_master" - } - ], - "errorSet": [ - { - "repoName": "ttps://github.com/reposense/testrepo-Beta.git", - "errorMessage": "ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL." - }, - { - "repoName": "reposense/testrepo-Delta[nonExistentBranch]", - "errorMessage": "Branch \"nonExistentBranch\" does not exist." - } - ], - "sinceDate": "2017-09-30", - "untilDate": "2019-03-02", - "isSinceDateProvided": true, - "isUntilDateProvided": true, - "supportedDomainUrlMap": { - "NOT_RECOGNIZED": { - "BRANCH": "", - "REPO_URL": "UNSUPPORTED", - "BASE_URL": "UNSUPPORTED", - "HISTORY_PATH": "", - "COMMIT_PATH": "", - "BLAME_PATH": "" - }, - "github": { - "BRANCH": "tree/$BRANCH", - "REPO_URL": "https://github.com/$ORGANIZATION/$REPO_NAME/", - "BASE_URL": "https://github.com/", - "HISTORY_PATH": "commits/$BRANCH/$FILE_PATH", - "COMMIT_PATH": "commit/$COMMIT_HASH", - "BLAME_PATH": "blame/$BRANCH/$FILE_PATH" - } - }, - "blurbs": { - "urlBlurbMap": { - "https://www.github.com/user/repo/branch": "first blurb", - "https://www.github.com/user/repo/branch2": "## **second** blurb\n\n![link](link) to repository\n\nthis is what i have done for my cs2103t project", - "https://www.github.com/user/repo/branch3": "*third blurb*\n\nthird blurb with HTML content" - } - } -} +{"reportGeneratedTime":"Tue Jul 24 17:45:15 SGT 2018","reportGenerationTime":"15 second(s)","zoneId":"Asia/Singapore","reportTitle":"RepoSense Report Test Title","repos":[{"location":{"location":"https://github.com/reposense/testrepo-Alpha.git","repoName":"testrepo-Alpha","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Alpha[master]","outputFolderName":"reposense_testrepo-Alpha_master"},{"location":{"location":"https://github.com/reposense/testrepo-Beta.git","repoName":"testrepo-Beta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Beta[master]","outputFolderName":"reposense_testrepo-Beta_master"},{"location":{"location":"https://github.com/reposense/testrepo-Charlie.git","repoName":"testrepo-Charlie","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Charlie[master]","outputFolderName":"reposense_testrepo-Charlie_master"},{"location":{"location":"https://github.com/reposense/testrepo-Delta.git","repoName":"testrepo-Delta","organization":"reposense","domainName":"github"},"branch":"master","displayName":"reposense/testrepo-Delta[master]","outputFolderName":"reposense_testrepo-Delta_master"}],"errorSet":[{"repoName":"ttps://github.com/reposense/testrepo-Beta.git","errorMessage":"ttps://github.com/reposense/testrepo-Beta.git is an invalid remote URL."},{"repoName":"reposense/testrepo-Delta[nonExistentBranch]","errorMessage":"Branch \"nonExistentBranch\" does not exist."}],"sinceDate":"2017-09-30","untilDate":"2019-03-02","isSinceDateProvided":true,"isUntilDateProvided":true,"supportedDomainUrlMap":{"NOT_RECOGNIZED":{"BRANCH":"","REPO_URL":"UNSUPPORTED","BASE_URL":"UNSUPPORTED","HISTORY_PATH":"","COMMIT_PATH":"","BLAME_PATH":""},"github":{"BRANCH":"tree/$BRANCH","REPO_URL":"https://github.com/$ORGANIZATION/$REPO_NAME/","BASE_URL":"https://github.com/","HISTORY_PATH":"commits/$BRANCH/$FILE_PATH","COMMIT_PATH":"commit/$COMMIT_HASH","BLAME_PATH":"blame/$BRANCH/$FILE_PATH"}}} diff --git a/src/systemtest/resources/LocalRepoSystemTest/testRelativePathing/summary.json b/src/systemtest/resources/LocalRepoSystemTest/testRelativePathing/summary.json index 33db57133d..73eb7dd989 100644 --- a/src/systemtest/resources/LocalRepoSystemTest/testRelativePathing/summary.json +++ b/src/systemtest/resources/LocalRepoSystemTest/testRelativePathing/summary.json @@ -1,47 +1 @@ -{ - "reportGeneratedTime": "Tue Jan 31 23:48:33 2023 UTC+08:00", - "reportGenerationTime": " 0.71 second(s)", - "zoneId": "UTC+08:00", - "reportTitle": "RepoSense Report", - "repos": [ - { - "location": { - "location": "parent1/../parent1/./test-repo", - "repoName": "testrepo-Alpha", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "parent1/test-repo[master]", - "outputFolderName": "parent1_test-repo_master" - } - ], - "errorSet": [], - "sinceDate": "2018-02-05", - "untilDate": "2023-01-31", - "isSinceDateProvided": true, - "isUntilDateProvided": true, - "supportedDomainUrlMap": { - "NOT_RECOGNIZED": { - "BRANCH": "", - "REPO_URL": "UNSUPPORTED", - "BASE_URL": "UNSUPPORTED", - "HISTORY_PATH": "", - "COMMIT_PATH": "", - "BLAME_PATH": "" - }, - "github": { - "BRANCH": "tree/$BRANCH", - "REPO_URL": "https://github.com/$ORGANIZATION/$REPO_NAME/", - "BASE_URL": "https://github.com/", - "HISTORY_PATH": "commits/$BRANCH/$FILE_PATH", - "COMMIT_PATH": "commit/$COMMIT_HASH", - "BLAME_PATH": "blame/$BRANCH/$FILE_PATH" - } - }, - "blurbs": { - "urlBlurbMap": { - "https://github.com/reposense/testrepo-Alpha/tree/master": "Master branch of testrepo-Alpha" - } - } -} +{"reportGeneratedTime":"Tue Jan 31 23:48:33 2023 UTC+08:00","reportGenerationTime":" 0.71 second(s)","zoneId":"UTC+08:00","reportTitle":"RepoSense Report","repos":[{"location":{"location":"parent1/../parent1/./test-repo","repoName":"testrepo-Alpha","organization":"reposense","domainName":"github"},"branch":"master","displayName":"parent1/test-repo[master]","outputFolderName":"parent1_test-repo_master"}],"errorSet":[],"sinceDate":"2018-02-05","untilDate":"2023-01-31","isSinceDateProvided":true,"isUntilDateProvided":true,"supportedDomainUrlMap":{"NOT_RECOGNIZED":{"BRANCH":"","REPO_URL":"UNSUPPORTED","BASE_URL":"UNSUPPORTED","HISTORY_PATH":"","COMMIT_PATH":"","BLAME_PATH":""},"github":{"BRANCH":"tree/$BRANCH","REPO_URL":"https://github.com/$ORGANIZATION/$REPO_NAME/","BASE_URL":"https://github.com/","HISTORY_PATH":"commits/$BRANCH/$FILE_PATH","COMMIT_PATH":"commit/$COMMIT_HASH","BLAME_PATH":"blame/$BRANCH/$FILE_PATH"}}} diff --git a/src/systemtest/resources/LocalRepoSystemTest/testSameFinalDirectory/summary.json b/src/systemtest/resources/LocalRepoSystemTest/testSameFinalDirectory/summary.json index a5662f38b5..fffce375ea 100644 --- a/src/systemtest/resources/LocalRepoSystemTest/testSameFinalDirectory/summary.json +++ b/src/systemtest/resources/LocalRepoSystemTest/testSameFinalDirectory/summary.json @@ -1,58 +1 @@ -{ - "reportGeneratedTime": "Tue Jan 31 23:34:35 2023 UTC+08:00", - "reportGenerationTime": " 0.74 second(s)", - "zoneId": "UTC+08:00", - "reportTitle": "RepoSense Report", - "repos": [ - { - "location": { - "location": "parent1/test-repo", - "repoName": "testrepo-Alpha", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "parent1/test-repo[master]", - "outputFolderName": "parent1_test-repo_master" - }, - { - "location": { - "location": "parent2/test-repo", - "repoName": "testrepo-Alpha", - "organization": "reposense", - "domainName": "github" - }, - "branch": "master", - "displayName": "parent2/test-repo[master]", - "outputFolderName": "parent2_test-repo_master" - } - ], - "errorSet": [], - "sinceDate": "2018-02-05", - "untilDate": "2023-01-31", - "isSinceDateProvided": true, - "isUntilDateProvided": true, - "supportedDomainUrlMap": { - "NOT_RECOGNIZED": { - "BRANCH": "", - "REPO_URL": "UNSUPPORTED", - "BASE_URL": "UNSUPPORTED", - "HISTORY_PATH": "", - "COMMIT_PATH": "", - "BLAME_PATH": "" - }, - "github": { - "BRANCH": "tree/$BRANCH", - "REPO_URL": "https://github.com/$ORGANIZATION/$REPO_NAME/", - "BASE_URL": "https://github.com/", - "HISTORY_PATH": "commits/$BRANCH/$FILE_PATH", - "COMMIT_PATH": "commit/$COMMIT_HASH", - "BLAME_PATH": "blame/$BRANCH/$FILE_PATH" - } - }, - "blurbs": { - "urlBlurbMap": { - "https://github.com/reposense/testrepo-Alpha/tree/master": "Master branch of testrepo-Alpha" - } - } -} +{"reportGeneratedTime":"Tue Jan 31 23:34:35 2023 UTC+08:00","reportGenerationTime":" 0.74 second(s)","zoneId":"UTC+08:00","reportTitle":"RepoSense Report","repos":[{"location":{"location":"parent1/test-repo","repoName":"testrepo-Alpha","organization":"reposense","domainName":"github"},"branch":"master","displayName":"parent1/test-repo[master]","outputFolderName":"parent1_test-repo_master"},{"location":{"location":"parent2/test-repo","repoName":"testrepo-Alpha","organization":"reposense","domainName":"github"},"branch":"master","displayName":"parent2/test-repo[master]","outputFolderName":"parent2_test-repo_master"}],"errorSet":[],"sinceDate":"2018-02-05","untilDate":"2023-01-31","isSinceDateProvided":true,"isUntilDateProvided":true,"supportedDomainUrlMap":{"NOT_RECOGNIZED":{"BRANCH":"","REPO_URL":"UNSUPPORTED","BASE_URL":"UNSUPPORTED","HISTORY_PATH":"","COMMIT_PATH":"","BLAME_PATH":""},"github":{"BRANCH":"tree/$BRANCH","REPO_URL":"https://github.com/$ORGANIZATION/$REPO_NAME/","BASE_URL":"https://github.com/","HISTORY_PATH":"commits/$BRANCH/$FILE_PATH","COMMIT_PATH":"commit/$COMMIT_HASH","BLAME_PATH":"blame/$BRANCH/$FILE_PATH"}}} diff --git a/src/test/java/reposense/model/BlurbMapTest.java b/src/test/java/reposense/model/BlurbMapTest.java deleted file mode 100644 index 463d0611aa..0000000000 --- a/src/test/java/reposense/model/BlurbMapTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package reposense.model; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class BlurbMapTest { - @Test - public void blurbBuilder_testIfBuildsSuccessfully_success() { - BlurbMap builder = new BlurbMap(); - builder.withRecord("hello", "world"); - BlurbMap newBuilder = new BlurbMap(); - newBuilder.withRecord("hello", "world"); - - Assertions.assertEquals(builder, newBuilder); - } - - @Test - public void blurbBuilder_testIfBuildsEmpty_success() { - BlurbMap map1 = new BlurbMap(); - BlurbMap map2 = new BlurbMap(); - Assertions.assertEquals(map1, map2); - } - - @Test - public void blurbBuilder_testIfUnequal_success() { - BlurbMap builder1 = new BlurbMap(); - BlurbMap builder2 = new BlurbMap(); - - builder1.withRecord("this", "builder"); - builder2.withRecord("other", "builder"); - Assertions.assertNotEquals(builder1, builder2); - } -} diff --git a/src/test/java/reposense/parser/BlurbMarkdownParserTest.java b/src/test/java/reposense/parser/BlurbMarkdownParserTest.java deleted file mode 100644 index 43531b7b31..0000000000 --- a/src/test/java/reposense/parser/BlurbMarkdownParserTest.java +++ /dev/null @@ -1,101 +0,0 @@ -package reposense.parser; - -import static reposense.util.TestUtil.loadResource; - -import java.nio.file.Path; -import java.util.List; -import java.util.Map; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import reposense.parser.exceptions.InvalidMarkdownException; - -public class BlurbMarkdownParserTest { - private static final Path EMPTY_BLURB_TESTER = loadResource(BlurbMarkdownParserTest.class, - "BlurbMarkdownParserTest/empty_blurbs.md"); - private static final Path MALFORMED_URL_TESTER = loadResource(BlurbMarkdownParserTest.class, - "BlurbMarkdownParserTest/malformed_url_blurb.md"); - private static final Path MALFORMED_DELIMITER_TESTER = loadResource(BlurbMarkdownParserTest.class, - "BlurbMarkdownParserTest/malformed_delimiter_blurb.md"); - private static final Path MULTILINE_BLURB_TESTER = loadResource(BlurbMarkdownParserTest.class, - "BlurbMarkdownParserTest/multiline_blurb.md"); - private static final Path MULTIPLE_BLURB_TESTER = loadResource(BlurbMarkdownParser.class, - "BlurbMarkdownParserTest/multiple_blurbs.md"); - - @Test - public void parse_emptyBlurbTest_throwsException() { - Assertions.assertThrows( - InvalidMarkdownException.class, () -> new BlurbMarkdownParser(EMPTY_BLURB_TESTER).parse() - ); - } - - @Test - public void parse_malformedUrlBlurbTest_throwsException() { - Assertions.assertThrows( - InvalidMarkdownException.class, () -> new BlurbMarkdownParser(MALFORMED_URL_TESTER).parse() - ); - } - - @Test - public void parse_malformedDelimiterBlurbTest_success() throws Exception { - BlurbMarkdownParser bmp = new BlurbMarkdownParser(MALFORMED_DELIMITER_TESTER); - Map bm = bmp.parse().getAllMappings(); - Assertions.assertTrue(bm.containsKey("https://github.com/reposense/testrepo-Alpha/tree/master")); - Assertions.assertEquals( - bm.get("https://github.com/reposense/testrepo-Alpha/tree/master"), - "Master branch of testrepo-Alpha\n" - + "" - ); - } - - @Test - public void parse_multilineBlurbTest_success() throws Exception { - BlurbMarkdownParser bmp = new BlurbMarkdownParser(MULTILINE_BLURB_TESTER); - Map bm = bmp.parse().getAllMappings(); - Assertions.assertTrue(bm.containsKey("https://github.com/reposense/testrepo-Alpha/tree/master")); - Assertions.assertEquals( - bm.get("https://github.com/reposense/testrepo-Alpha/tree/master"), - "Master branch of testrepo-Alpha\n" - + "A\n" - + "long\n" - + "line\n" - + "of\n" - + "description\n" - + "of\n" - + "testrepo\n" - + "Alpha" - ); - } - - @Test - public void parse_multipleBlurbTest_success() throws Exception { - BlurbMarkdownParser bmp = new BlurbMarkdownParser(MULTIPLE_BLURB_TESTER); - Map bm = bmp.parse().getAllMappings(); - Assertions.assertTrue(bm.keySet().containsAll( - List.of("https://github.com/reposense/testrepo-Alpha/tree/master", - "https://github.com/reposense/testrepo-Beta/tree/master", - "https://github.com/reposense/testrepo-Gamma/tree/master", - "https://github.com/reposense/testrepo-Sigma/tree/master") - )); - Assertions.assertEquals( - bm.get("https://github.com/reposense/testrepo-Alpha/tree/master"), - "Master branch of testrepo-Alpha" - ); - Assertions.assertEquals( - bm.get("https://github.com/reposense/testrepo-Beta/tree/master"), - "Master branch of testrepo-Beta" - ); - Assertions.assertEquals( - bm.get("https://github.com/reposense/testrepo-Gamma/tree/master"), - "Master branch of testrepo-Gamma" - ); - Assertions.assertEquals( - bm.get("https://github.com/reposense/testrepo-Sigma/tree/master"), - "Master branch of testrepo-Sigma" - ); - } -} diff --git a/src/test/resources/BlurbMarkdownParserTest/empty_blurbs.md b/src/test/resources/BlurbMarkdownParserTest/empty_blurbs.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/test/resources/BlurbMarkdownParserTest/malformed_delimiter_blurb.md b/src/test/resources/BlurbMarkdownParserTest/malformed_delimiter_blurb.md deleted file mode 100644 index 95f0ba1c44..0000000000 --- a/src/test/resources/BlurbMarkdownParserTest/malformed_delimiter_blurb.md +++ /dev/null @@ -1,7 +0,0 @@ -https://github.com/reposense/testrepo-Alpha/tree/master -Master branch of testrepo-Alpha - -but this is legal and will be ignored diff --git a/src/test/resources/BlurbMarkdownParserTest/malformed_url_blurb.md b/src/test/resources/BlurbMarkdownParserTest/malformed_url_blurb.md deleted file mode 100644 index 3b68b169c7..0000000000 --- a/src/test/resources/BlurbMarkdownParserTest/malformed_url_blurb.md +++ /dev/null @@ -1,2 +0,0 @@ -://github/reposense/testrepo-Alp -Malformed URL Test diff --git a/src/test/resources/BlurbMarkdownParserTest/multiline_blurb.md b/src/test/resources/BlurbMarkdownParserTest/multiline_blurb.md deleted file mode 100644 index a2a4711e01..0000000000 --- a/src/test/resources/BlurbMarkdownParserTest/multiline_blurb.md +++ /dev/null @@ -1,10 +0,0 @@ -https://github.com/reposense/testrepo-Alpha/tree/master -Master branch of testrepo-Alpha -A -long -line -of -description -of -testrepo -Alpha diff --git a/src/test/resources/BlurbMarkdownParserTest/multiple_blurbs.md b/src/test/resources/BlurbMarkdownParserTest/multiple_blurbs.md deleted file mode 100644 index b49af3b1e7..0000000000 --- a/src/test/resources/BlurbMarkdownParserTest/multiple_blurbs.md +++ /dev/null @@ -1,12 +0,0 @@ -https://github.com/reposense/testrepo-Alpha/tree/master -Master branch of testrepo-Alpha - -https://github.com/reposense/testrepo-Beta/tree/master -Master branch of testrepo-Beta - -https://github.com/reposense/testrepo-Gamma/tree/master -Master branch of testrepo-Gamma - -https://github.com/reposense/testrepo-Sigma/tree/master -Master branch of testrepo-Sigma -