Skip to content

Commit 85f056b

Browse files
author
Benjamin E. Coe
authored
fix: versions were not being updated in the root composer.json file (#281)
1 parent ac1b907 commit 85f056b

6 files changed

Lines changed: 571 additions & 13 deletions

File tree

__snapshots__/java-yoshi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports['CHANGELOG'] = `
66
77
### Bug Fixes
88
9-
* Fix declared dependencies from merge issue ([#291](https://www.github.com/googleapis/java-trace/issues/291)) ([35abf13](https://www.github.com/googleapis/java-trace/commit/35abf13))
9+
* Fix declared dependencies from merge issue ([#291](https://www.github.com/googleapis/java-trace/issues/291)) ([35abf13](https://www.github.com/googleapis/java-trace/commit/35abf13fa8acb3988aa086f3eb23f5ce1483cc5d))
1010
1111
`
1212

@@ -484,7 +484,7 @@ exports['PR body'] = `
484484
485485
### Bug Fixes
486486
487-
* Fix declared dependencies from merge issue ([#291](https://www.github.com/googleapis/java-trace/issues/291)) ([35abf13](https://www.github.com/googleapis/java-trace/commit/35abf13))
487+
* Fix declared dependencies from merge issue ([#291](https://www.github.com/googleapis/java-trace/issues/291)) ([35abf13](https://www.github.com/googleapis/java-trace/commit/35abf13fa8acb3988aa086f3eb23f5ce1483cc5d))
488488
---
489489
490490

__snapshots__/release-pr.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ exports['GitHub Yoshi PHP Mono-Repo generates CHANGELOG and aborts if duplicate
2929
3030
### Bug Fixes
3131
32-
* correctly label as beta ([#1963](https://www.github.com/googleapis/release-please/issues/1963)) ([52f4fbf](https://www.github.com/googleapis/release-please/commit/52f4fbf))
32+
* correctly label as beta ([#1963](https://www.github.com/googleapis/release-please/issues/1963)) ([52f4fbf](https://www.github.com/googleapis/release-please/commit/52f4fbfa1fc3fde585c84e64ef40571d2b85d72e))
3333
3434
</details>
3535
@@ -39,7 +39,7 @@ exports['GitHub Yoshi PHP Mono-Repo generates CHANGELOG and aborts if duplicate
3939
4040
### Bug Fixes
4141
42-
* Assorted minor fixes for Cloud Datastore client ([#1964](https://www.github.com/googleapis/release-please/issues/1964)) ([269cf92](https://www.github.com/googleapis/release-please/commit/269cf92))
42+
* Assorted minor fixes for Cloud Datastore client ([#1964](https://www.github.com/googleapis/release-please/issues/1964)) ([269cf92](https://www.github.com/googleapis/release-please/commit/269cf923ea6fd0375abaf0bb19790475693c6f90))
4343
4444
</details>
4545
@@ -49,7 +49,7 @@ exports['GitHub Yoshi PHP Mono-Repo generates CHANGELOG and aborts if duplicate
4949
5050
### Bug Fixes
5151
52-
* Update PubSub timeouts. ([#1967](https://www.github.com/googleapis/release-please/issues/1967)) ([0a84771](https://www.github.com/googleapis/release-please/commit/0a84771))
52+
* Update PubSub timeouts. ([#1967](https://www.github.com/googleapis/release-please/issues/1967)) ([0a84771](https://www.github.com/googleapis/release-please/commit/0a8477108a26aeb21d7af06e62be4ae5cb00ad42))
5353
5454
</details>
5555
@@ -59,7 +59,7 @@ exports['GitHub Yoshi PHP Mono-Repo generates CHANGELOG and aborts if duplicate
5959
6060
### Features
6161
62-
* move speech from alpha -> beta ([#1962](https://www.github.com/googleapis/release-please/issues/1962)) ([8db7f3b](https://www.github.com/googleapis/release-please/commit/8db7f3b))
62+
* move speech from alpha -> beta ([#1962](https://www.github.com/googleapis/release-please/issues/1962)) ([8db7f3b](https://www.github.com/googleapis/release-please/commit/8db7f3b19c46c873897d79c89ce35b8492e5fe60))
6363
6464
</details>
6565
@@ -69,7 +69,7 @@ exports['GitHub Yoshi PHP Mono-Repo generates CHANGELOG and aborts if duplicate
6969
7070
### Features
7171
72-
* Add Web Security Center Client ([#1961](https://www.github.com/googleapis/release-please/issues/1961)) ([fa5761e](https://www.github.com/googleapis/release-please/commit/fa5761e))
72+
* Add Web Security Center Client ([#1961](https://www.github.com/googleapis/release-please/issues/1961)) ([fa5761e](https://www.github.com/googleapis/release-please/commit/fa5761e9e52f36506a72a9292843259d198468b0))
7373
7474
</details>
7575

__snapshots__/root-composer.js

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
exports['composer.json updateContent updates all versions in root composer file 1'] = `
2+
{
3+
"name": "google/cloud",
4+
"type": "library",
5+
"description": "Google Cloud Client Library",
6+
"keywords": [
7+
"google apis client",
8+
"google api client",
9+
"google apis",
10+
"google api",
11+
"google",
12+
"google cloud platform",
13+
"google cloud",
14+
"cloud",
15+
"bigtable",
16+
"bigquery",
17+
"big query",
18+
"datastore",
19+
"stackdriver logging",
20+
"kms",
21+
"language",
22+
"natural language",
23+
"pubsub",
24+
"pub sub",
25+
"spanner",
26+
"speech",
27+
"storage",
28+
"gcs",
29+
"tasks",
30+
"translate",
31+
"translation",
32+
"vision"
33+
],
34+
"homepage": "http://github.com/googleapis/google-cloud-php",
35+
"license": "Apache-2.0",
36+
"authors": [
37+
{
38+
"name": "Dave Supplee",
39+
"email": "dwsupplee@gmail.com"
40+
},
41+
{
42+
"name": "John Pedrie",
43+
"email": "john@pedrie.com"
44+
}
45+
],
46+
"require": {
47+
"php": ">=5.5",
48+
"rize/uri-template": "~0.3",
49+
"guzzlehttp/guzzle": "^5.3|^6.0",
50+
"guzzlehttp/psr7": "^1.2",
51+
"monolog/monolog": "^1.1|^2.0",
52+
"psr/http-message": "1.0.*",
53+
"ramsey/uuid": "~3",
54+
"google/gax": "^1.1",
55+
"google/common-protos": "^1.0",
56+
"google/auth": "^1.6",
57+
"google/crc32": "^0.1.0"
58+
},
59+
"require-dev": {
60+
"phpunit/phpunit": "^4.8|^5.0",
61+
"squizlabs/php_codesniffer": "2.*",
62+
"phpdocumentor/reflection": "^3.0",
63+
"symfony/console": "^3.0",
64+
"erusev/parsedown": "^1.6",
65+
"vierbergenlars/php-semver": "^3.0",
66+
"symfony/lock": "3.3.x-dev#1ba6ac9",
67+
"phpseclib/phpseclib": "^2",
68+
"google/cloud-tools": "^0.9.0",
69+
"opis/closure": "^3.0",
70+
"swaggest/json-schema": "^0.12.0"
71+
},
72+
"replace": {
73+
"google/cloud-asset": "0.4.0",
74+
"google/cloud-automl": "0.8.0",
75+
"google/cloud-bigquery": "1.12.1",
76+
"google/cloud-bigquerydatatransfer": "0.14.0",
77+
"google/cloud-bigtable": "1.1.0",
78+
"google/cloud-common-protos": "0.2.0",
79+
"google/cloud-container": "0.11.0",
80+
"google/cloud-core": "1.33.1",
81+
"google/cloud-dataproc": "0.15.0",
82+
"google/cloud-datastore": "1.10.0",
83+
"google/cloud-debugger": "0.19.1",
84+
"google/cloud-dialogflow": "0.10.0",
85+
"google/cloud-dlp": "0.22.0",
86+
"google/cloud-error-reporting": "0.15.0",
87+
"google/cloud-firestore": "1.9.0",
88+
"google/cloud-iot": "0.9.0",
89+
"google/cloud-kms": "1.7.0",
90+
"google/cloud-language": "0.21.0",
91+
"google/cloud-logging": "1.18.0",
92+
"google/cloud-monitoring": "0.18.0",
93+
"google/cloud-oslogin": "0.10.0",
94+
"google/cloud-pubsub": "1.18.0",
95+
"google/cloud-redis": "0.10.0",
96+
"google/cloud-scheduler": "1.1.0",
97+
"google/cloud-security-center": "0.2.0",
98+
"google/cloud-spanner": "1.20.0",
99+
"google/cloud-speech": "0.27.0",
100+
"google/cloud-storage": "1.14.0",
101+
"google/cloud-talent": "1.0.0",
102+
"google/cloud-tasks": "1.3.0",
103+
"google/cloud-text-to-speech": "0.5.0",
104+
"google/cloud-trace": "0.15.0",
105+
"google/cloud-translate": "1.5.0",
106+
"google/cloud-videointelligence": "1.7.0",
107+
"google/cloud-vision": "0.24.0",
108+
"google/cloud-web-risk": "0.3.0",
109+
"google/cloud-web-security-scanner": "0.2.0"
110+
},
111+
"suggest": {
112+
"opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.",
113+
"phpseclib/phpseclib": "May be used in place of OpenSSL for creating signed Cloud Storage URLs. Please require version ^2."
114+
},
115+
"autoload": {
116+
"psr-4": {
117+
"Google\\\\Cloud\\\\": [
118+
"src",
119+
"CommonProtos/src"
120+
],
121+
"Google\\\\Cloud\\\\Asset\\\\": "Asset/src",
122+
"Google\\\\Cloud\\\\AutoMl\\\\": "AutoMl/src",
123+
"Google\\\\Cloud\\\\BigQuery\\\\": "BigQuery/src",
124+
"Google\\\\Cloud\\\\BigQuery\\\\DataTransfer\\\\": "BigQueryDataTransfer/src",
125+
"Google\\\\Cloud\\\\Bigtable\\\\": "Bigtable/src",
126+
"Google\\\\Cloud\\\\Container\\\\": "Container/src",
127+
"Google\\\\Cloud\\\\Core\\\\": "Core/src",
128+
"Google\\\\Cloud\\\\Dataproc\\\\": "Dataproc/src",
129+
"Google\\\\Cloud\\\\Datastore\\\\": "Datastore/src",
130+
"Google\\\\Cloud\\\\Debugger\\\\": "Debugger/src",
131+
"Google\\\\Cloud\\\\Dialogflow\\\\": "Dialogflow/src",
132+
"Google\\\\Cloud\\\\Dlp\\\\": "Dlp/src",
133+
"Google\\\\Cloud\\\\ErrorReporting\\\\": "ErrorReporting/src",
134+
"Google\\\\Cloud\\\\Firestore\\\\": "Firestore/src",
135+
"Google\\\\Cloud\\\\Iot\\\\": "Iot/src",
136+
"Google\\\\Cloud\\\\Kms\\\\": "Kms/src",
137+
"Google\\\\Cloud\\\\Language\\\\": "Language/src",
138+
"Google\\\\Cloud\\\\Logging\\\\": "Logging/src",
139+
"Google\\\\Cloud\\\\Monitoring\\\\": "Monitoring/src",
140+
"Google\\\\Cloud\\\\OsLogin\\\\": "OsLogin/src",
141+
"Google\\\\Cloud\\\\PubSub\\\\": "PubSub/src",
142+
"Google\\\\Cloud\\\\Redis\\\\": "Redis/src",
143+
"Google\\\\Cloud\\\\Scheduler\\\\": "Scheduler/src",
144+
"Google\\\\Cloud\\\\SecurityCenter\\\\": "SecurityCenter/src",
145+
"Google\\\\Cloud\\\\Spanner\\\\": "Spanner/src",
146+
"Google\\\\Cloud\\\\Speech\\\\": "Speech/src",
147+
"Google\\\\Cloud\\\\Storage\\\\": "Storage/src",
148+
"Google\\\\Cloud\\\\Talent\\\\": "Talent/src",
149+
"Google\\\\Cloud\\\\Tasks\\\\": "Tasks/src",
150+
"Google\\\\Cloud\\\\TextToSpeech\\\\": "TextToSpeech/src",
151+
"Google\\\\Cloud\\\\Trace\\\\": "Trace/src",
152+
"Google\\\\Cloud\\\\Translate\\\\": "Translate/src",
153+
"Google\\\\Cloud\\\\VideoIntelligence\\\\": "VideoIntelligence/src",
154+
"Google\\\\Cloud\\\\Vision\\\\": "Vision/src",
155+
"Google\\\\Cloud\\\\WebRisk\\\\": "WebRisk/src",
156+
"Google\\\\Cloud\\\\WebSecurityScanner\\\\": "WebSecurityScanner/src",
157+
"GPBMetadata\\\\Google\\\\": "CommonProtos/metadata",
158+
"GPBMetadata\\\\Google\\\\Bigtable\\\\": "Bigtable/metadata",
159+
"GPBMetadata\\\\Google\\\\Container\\\\": "Container/metadata",
160+
"GPBMetadata\\\\Google\\\\Cloud\\\\Asset\\\\": "Asset/metadata",
161+
"GPBMetadata\\\\Google\\\\Cloud\\\\Automl\\\\": "AutoMl/metadata",
162+
"GPBMetadata\\\\Google\\\\Cloud\\\\Bigquery\\\\Datatransfer\\\\": "BigQueryDataTransfer/metadata",
163+
"GPBMetadata\\\\Google\\\\Cloud\\\\Dataproc\\\\": "Dataproc/metadata",
164+
"GPBMetadata\\\\Google\\\\Cloud\\\\Dialogflow\\\\": "Dialogflow/metadata",
165+
"GPBMetadata\\\\Google\\\\Cloud\\\\Iot\\\\": "Iot/metadata",
166+
"GPBMetadata\\\\Google\\\\Cloud\\\\Kms\\\\": "Kms/metadata",
167+
"GPBMetadata\\\\Google\\\\Cloud\\\\Language\\\\": "Language/metadata",
168+
"GPBMetadata\\\\Google\\\\Cloud\\\\Oslogin\\\\": "OsLogin/metadata",
169+
"GPBMetadata\\\\Google\\\\Cloud\\\\Redis\\\\": "Redis/metadata",
170+
"GPBMetadata\\\\Google\\\\Cloud\\\\Scheduler\\\\": "Scheduler/metadata",
171+
"GPBMetadata\\\\Google\\\\Cloud\\\\Securitycenter\\\\": "SecurityCenter/metadata",
172+
"GPBMetadata\\\\Google\\\\Cloud\\\\Speech\\\\": "Speech/metadata",
173+
"GPBMetadata\\\\Google\\\\Cloud\\\\Talent\\\\": "Talent/metadata",
174+
"GPBMetadata\\\\Google\\\\Cloud\\\\Tasks\\\\": "Tasks/metadata",
175+
"GPBMetadata\\\\Google\\\\Cloud\\\\Texttospeech\\\\": "TextToSpeech/metadata",
176+
"GPBMetadata\\\\Google\\\\Cloud\\\\Translate\\\\": "Translate/metadata",
177+
"GPBMetadata\\\\Google\\\\Cloud\\\\Videointelligence\\\\": "VideoIntelligence/metadata",
178+
"GPBMetadata\\\\Google\\\\Cloud\\\\Vision\\\\": "Vision/metadata",
179+
"GPBMetadata\\\\Google\\\\Cloud\\\\Webrisk\\\\": "WebRisk/metadata",
180+
"GPBMetadata\\\\Google\\\\Cloud\\\\Websecurityscanner\\\\": "WebSecurityScanner/metadata",
181+
"GPBMetadata\\\\Google\\\\Datastore\\\\": "Datastore/metadata",
182+
"GPBMetadata\\\\Google\\\\Devtools\\\\Clouddebugger\\\\": "Debugger/metadata",
183+
"GPBMetadata\\\\Google\\\\Devtools\\\\Clouderrorreporting\\\\": "ErrorReporting/metadata",
184+
"GPBMetadata\\\\Google\\\\Devtools\\\\Cloudtrace\\\\": "Trace/metadata",
185+
"GPBMetadata\\\\Google\\\\Firestore\\\\": "Firestore/metadata",
186+
"GPBMetadata\\\\Google\\\\Logging\\\\": "Logging/metadata",
187+
"GPBMetadata\\\\Google\\\\Monitoring\\\\": "Monitoring/metadata",
188+
"GPBMetadata\\\\Google\\\\Privacy\\\\Dlp\\\\": "Dlp/metadata",
189+
"GPBMetadata\\\\Google\\\\Pubsub\\\\": "PubSub/metadata",
190+
"GPBMetadata\\\\Google\\\\Spanner\\\\": "Spanner/metadata"
191+
}
192+
},
193+
"autoload-dev": {
194+
"psr-4": {
195+
"Google\\\\Cloud\\\\Dev\\\\": "dev/src",
196+
"Google\\\\Cloud\\\\Tests\\\\": "tests",
197+
"Google\\\\Cloud\\\\CommonProtos\\\\Tests\\\\": "CommonProtos/tests",
198+
"Google\\\\Cloud\\\\Asset\\\\Tests\\\\": "Asset/tests",
199+
"Google\\\\Cloud\\\\AutoMl\\\\Tests\\\\": "AutoMl/tests",
200+
"Google\\\\Cloud\\\\BigQuery\\\\Tests\\\\": "BigQuery/tests",
201+
"Google\\\\Cloud\\\\BigQuery\\\\DataTransfer\\\\Tests\\\\": "BigQueryDataTransfer/tests",
202+
"Google\\\\Cloud\\\\Bigtable\\\\Tests\\\\": "Bigtable/tests",
203+
"Google\\\\Cloud\\\\Container\\\\Tests\\\\": "Container/tests",
204+
"Google\\\\Cloud\\\\Core\\\\Tests\\\\": "Core/tests",
205+
"Google\\\\Cloud\\\\Dataproc\\\\Tests\\\\": "Dataproc/tests",
206+
"Google\\\\Cloud\\\\Datastore\\\\Tests\\\\": "Datastore/tests",
207+
"Google\\\\Cloud\\\\Debugger\\\\Tests\\\\": "Debugger/tests",
208+
"Google\\\\Cloud\\\\Dialogflow\\\\Tests\\\\": "Dialogflow/tests",
209+
"Google\\\\Cloud\\\\Dlp\\\\Tests\\\\": "Dlp/tests",
210+
"Google\\\\Cloud\\\\ErrorReporting\\\\Tests\\\\": "ErrorReporting/tests",
211+
"Google\\\\Cloud\\\\Firestore\\\\Tests\\\\": "Firestore/tests",
212+
"Google\\\\Cloud\\\\Iot\\\\Tests\\\\": "Iot/tests",
213+
"Google\\\\Cloud\\\\Kms\\\\Tests\\\\": "Kms/tests",
214+
"Google\\\\Cloud\\\\Language\\\\Tests\\\\": "Language/tests",
215+
"Google\\\\Cloud\\\\Logging\\\\Tests\\\\": "Logging/tests",
216+
"Google\\\\Cloud\\\\Monitoring\\\\Tests\\\\": "Monitoring/tests",
217+
"Google\\\\Cloud\\\\OsLogin\\\\Tests\\\\": "OsLogin/tests",
218+
"Google\\\\Cloud\\\\PubSub\\\\Tests\\\\": "PubSub/tests",
219+
"Google\\\\Cloud\\\\Redis\\\\Tests\\\\": "Redis/tests",
220+
"Google\\\\Cloud\\\\Scheduler\\\\Tests\\\\": "Scheduler/tests",
221+
"Google\\\\Cloud\\\\SecurityCenter\\\\Tests\\\\": "SecurityCenter/tests",
222+
"Google\\\\Cloud\\\\Spanner\\\\Tests\\\\": "Spanner/tests",
223+
"Google\\\\Cloud\\\\Speech\\\\Tests\\\\": "Speech/tests",
224+
"Google\\\\Cloud\\\\Storage\\\\Tests\\\\": "Storage/tests",
225+
"Google\\\\Cloud\\\\Talent\\\\Tests\\\\": "Talent/tests",
226+
"Google\\\\Cloud\\\\Tasks\\\\Tests\\\\": "Tasks/tests",
227+
"Google\\\\Cloud\\\\TextToSpeech\\\\Tests\\\\": "TextToSpeech/tests",
228+
"Google\\\\Cloud\\\\Trace\\\\Tests\\\\": "Trace/tests",
229+
"Google\\\\Cloud\\\\Translate\\\\Tests\\\\": "Translate/tests",
230+
"Google\\\\Cloud\\\\VideoIntelligence\\\\Tests\\\\": "VideoIntelligence/tests",
231+
"Google\\\\Cloud\\\\Vision\\\\Tests\\\\": "Vision/tests",
232+
"Google\\\\Cloud\\\\WebRisk\\\\Tests\\\\": "WebRisk/tests",
233+
"Google\\\\Cloud\\\\WebSecurityScanner\\\\Tests\\\\": "WebSecurityScanner/tests"
234+
}
235+
},
236+
"scripts": {
237+
"google-cloud": "dev/google-cloud",
238+
"style": "dev/sh/style",
239+
"tests": "dev/sh/tests"
240+
},
241+
"bin": [
242+
"Core/bin/google-cloud-batch",
243+
"Debugger/bin/google-cloud-debugger"
244+
],
245+
"extra": {
246+
"component": {
247+
"id": "google-cloud",
248+
"target": "googleapis/google-cloud-php.git",
249+
"path": "src",
250+
"entry": [
251+
"Version.php",
252+
"ServiceBuilder.php"
253+
]
254+
}
255+
}
256+
}
257+
258+
`

src/updaters/root-composer.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,24 @@ export class RootComposer implements Update {
3636
this.packageName = options.packageName;
3737
}
3838
updateContent(content: string): string {
39-
if (!this.versions || Object.keys(this.versions).length === 0) {
39+
if (!this.versions || this.versions.size === 0) {
4040
checkpoint(
4141
`no updates necessary for ${this.path}`,
4242
CheckpointType.Failure
4343
);
4444
return content;
4545
}
4646
const parsed = JSON.parse(content);
47-
Object.keys(this.versions).forEach((key: string) => {
48-
if (this.versions) {
49-
const version: string = this.versions.get(key) || '1.0.0';
47+
if (this.versions) {
48+
for (let [key, version] of this.versions.entries()) {
49+
version = version || '1.0.0';
5050
checkpoint(
5151
`updating ${key} from ${parsed.replace[key]} to ${version}`,
5252
CheckpointType.Success
5353
);
5454
parsed.replace[key] = version;
5555
}
56-
});
57-
56+
}
5857
return JSON.stringify(parsed, null, 4) + '\n';
5958
}
6059
}

0 commit comments

Comments
 (0)