release-please 13.16.1 → 13.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ### [13.16.2](https://github.com/googleapis/release-please/compare/v13.16.1...v13.16.2) (2022-05-12)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * throw ConfigurationError when required manifest config file is missing ([#1422](https://github.com/googleapis/release-please/issues/1422)) ([83e461e](https://github.com/googleapis/release-please/commit/83e461e8947d16fbd92d57a0d9c64d37ab0dfa42))
13
+
7
14
  ### [13.16.1](https://github.com/googleapis/release-please/compare/v13.16.0...v13.16.1) (2022-05-10)
8
15
 
9
16
 
@@ -729,7 +729,7 @@ function extractReleaserConfig(config) {
729
729
  * @param {string} releaseAs Optional. Override release-as and use the given version
730
730
  */
731
731
  async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
732
- const config = await github.getFileJson(configFile, branch);
732
+ const config = await fetchManifestConfig(github, configFile, branch);
733
733
  const defaultConfig = extractReleaserConfig(config);
734
734
  const repositoryConfig = {};
735
735
  for (const path in config.packages) {
@@ -759,21 +759,61 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
759
759
  };
760
760
  return { config: repositoryConfig, options: manifestOptions };
761
761
  }
762
+ /**
763
+ * Helper to fetch manifest config
764
+ *
765
+ * @param {GitHub} github
766
+ * @param {string} configFile
767
+ * @param {string} branch
768
+ * @returns {ManifestConfig}
769
+ * @throws {ConfigurationError} if missing the manifest config file
770
+ */
771
+ async function fetchManifestConfig(github, configFile, branch) {
772
+ try {
773
+ return await github.getFileJson(configFile, branch);
774
+ }
775
+ catch (e) {
776
+ if (e instanceof errors_1.FileNotFoundError) {
777
+ throw new errors_1.ConfigurationError(`Missing required manifest config: ${configFile}`, 'base', `${github.repository.owner}/${github.repository.repo}`);
778
+ }
779
+ throw e;
780
+ }
781
+ }
762
782
  /**
763
783
  * Helper to parse the manifest versions file.
764
784
  *
765
785
  * @param {GitHub} github GitHub client
766
786
  * @param {string} manifestFile Path in the repository to the versions file
767
787
  * @param {string} branch Branch to fetch the versions file from
788
+ * @returns {Record<string, string>}
768
789
  */
769
790
  async function parseReleasedVersions(github, manifestFile, branch) {
770
- const manifestJson = await github.getFileJson(manifestFile, branch);
791
+ const manifestJson = await fetchReleasedVersions(github, manifestFile, branch);
771
792
  const releasedVersions = {};
772
793
  for (const path in manifestJson) {
773
794
  releasedVersions[path] = version_1.Version.parse(manifestJson[path]);
774
795
  }
775
796
  return releasedVersions;
776
797
  }
798
+ /**
799
+ * Helper to fetch manifest config
800
+ *
801
+ * @param {GitHub} github
802
+ * @param {string} manifestFile
803
+ * @param {string} branch
804
+ * @throws {ConfigurationError} if missing the manifest config file
805
+ */
806
+ async function fetchReleasedVersions(github, manifestFile, branch) {
807
+ try {
808
+ return await github.getFileJson(manifestFile, branch);
809
+ }
810
+ catch (e) {
811
+ if (e instanceof errors_1.FileNotFoundError) {
812
+ throw new errors_1.ConfigurationError(`Missing required manifest versions: ${manifestFile}`, 'base', `${github.repository.owner}/${github.repository.repo}`);
813
+ }
814
+ throw e;
815
+ }
816
+ }
777
817
  function isPublishedVersion(strategy, version) {
778
818
  return strategy.isPublishedVersion
779
819
  ? strategy.isPublishedVersion(version)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.16.1",
3
+ "version": "13.16.2",
4
4
  "description": "generate release PRs based on the conventionalcommits.org spec",
5
5
  "main": "./build/src/index.js",
6
6
  "bin": "./build/src/bin/release-please.js",