diff --git a/CHANGELOG.md b/CHANGELOG.md index 780ced444..b47419a0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,18 @@ All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## Unreleased [patch] + +_Full changeset and discussions: [#1026](https://github.com/OpenTermsArchive/engine/pull/1026)._ + +### Added + +- Ensure `Reporter` configuration is defined before instantiating it +- Ensure to add links to `versions` and `snapshots` in issues only if repositories are defined in configuration + +### Removed + +- No longer define default configuration for `Reporter` module ## 0.32.0 - 2023-10-18 @@ -16,6 +27,8 @@ _Full changeset and discussions: [#1025](https://github.com/OpenTermsArchive/eng ### Changed - **Breaking:** Revise the formatting of reported issues, with notable adjustments to the title, transitioning from `Fix - ` to ` ‧ not tracked anymore` +- **Breaking:** Rename `tracker` module into `reporter`; update your configuration file by renaming `tracker` into `reporter` +- **Breaking:** Change configuration for `reporter` module; update your `reporter` [configuration accordingly](https://docs.opentermsarchive.org/#configuring) ### Removed diff --git a/config/default.json b/config/default.json index e854c4677..8c37ec7b9 100644 --- a/config/default.json +++ b/config/default.json @@ -54,15 +54,6 @@ "updateTemplateId": 7 } }, - "reporter": { - "githubIssues": { - "repositories": { - "declarations": "OpenTermsArchive/sandbox-declarations", - "versions": "OpenTermsArchive/sandbox-versions", - "snapshots": "OpenTermsArchive/sandbox-snapshots" - } - } - }, "dataset": { "title": "sandbox", "versionsRepositoryURL": "https://github.com/OpenTermsArchive/sandbox" diff --git a/src/index.js b/src/index.js index 47d0eded0..6c8873a71 100644 --- a/src/index.js +++ b/src/index.js @@ -43,10 +43,14 @@ export default async function track({ services, types, extractOnly, schedule }) } if (process.env.GITHUB_TOKEN) { - const reporter = new Reporter(config.get('reporter')); - - await reporter.initialize(); - archivist.attach(reporter); + if (config.has('reporter.githubIssues.repositories.declarations')) { + const reporter = new Reporter(config.get('reporter')); + + await reporter.initialize(); + archivist.attach(reporter); + } else { + logger.warn('Configuration key "reporter.githubIssues.repositories.declarations" was not found; the Reporter module will be ignored\n'); + } } if (!schedule) { diff --git a/src/reporter/index.js b/src/reporter/index.js index 10fab5f8d..d152d8194 100644 --- a/src/reporter/index.js +++ b/src/reporter/index.js @@ -132,8 +132,8 @@ If the source documents are accessible in a browser but fetching them always fai ### References - ${latestDeclarationLink} -- ${latestVersionLink} -- ${latestSnapshotsLink} +${this.repositories.versions ? `- ${latestVersionLink}` : ''} +${this.repositories.snapshots ? `- ${latestSnapshotsLink}` : ''} `; /* eslint-enable no-irregular-whitespace */ }