Skip to content

Commit eee8da1

Browse files
authored
chore: Fix release_please_config script (googleapis#8480)
* chore: Fix the release-please-config script * chore: Remove quote around the boolean values * chore: add comments for release please config generator * chore: Rename to artifact_name * chore: Add in manual version bump * chore: Remove hard code for gapic-bom version * chore: Update the config.json file * chore: Add new configs
1 parent 9a9d037 commit eee8da1

117 files changed

Lines changed: 1042 additions & 1052 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.release-please-manifest.json‎

Lines changed: 112 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,134 @@
11
{
22
"google-cloud-gapic-bom": "0.0.0",
3-
"java-accessapproval": "2.4.8",
4-
"java-accesscontextmanager": "1.4.3",
5-
"java-aiplatform": "3.3.0",
6-
"java-analytics-admin": "0.13.2",
7-
"java-analytics-data": "0.14.6",
8-
"java-api-gateway": "2.3.4",
9-
"java-apigee-connect": "2.3.4",
10-
"java-apigee-registry": "0.3.0",
3+
"java-accessapproval": "2.4.9",
4+
"java-accesscontextmanager": "1.4.5",
5+
"java-aiplatform": "3.4.0",
6+
"java-analytics-admin": "0.13.4",
7+
"java-analytics-data": "0.14.7",
8+
"java-api-gateway": "2.3.6",
9+
"java-apigee-connect": "2.3.7",
10+
"java-apigee-registry": "0.3.1",
1111
"java-appengine-admin": "2.3.4",
12-
"java-area120-tables": "0.7.4",
13-
"java-artifact-registry": "1.2.7",
14-
"java-asset": "3.6.0",
15-
"java-assured-workloads": "2.2.0",
16-
"java-automl": "2.3.14",
17-
"java-bare-metal-solution": "0.3.4",
18-
"java-batch": "0.3.0",
12+
"java-area120-tables": "0.7.8",
13+
"java-artifact-registry": "1.2.9",
14+
"java-asset": "3.7.0",
15+
"java-assured-workloads": "2.2.1",
16+
"java-automl": "2.3.16",
17+
"java-bare-metal-solution": "0.3.7",
18+
"java-batch": "0.3.2",
1919
"java-beyondcorp-appconnections": "0.0.0",
2020
"java-beyondcorp-appconnectors": "0.0.0",
2121
"java-beyondcorp-appgateways": "0.0.0",
2222
"java-beyondcorp-clientconnectorservices": "0.1.2",
2323
"java-beyondcorp-clientgateways": "0.0.0",
24-
"java-bigqueryconnection": "2.5.4",
24+
"java-bigqueryconnection": "2.5.5",
2525
"java-bigquery-data-exchange": "0.3.2",
26-
"java-bigquerydatatransfer": "2.3.14",
27-
"java-bigquerymigration": "0.6.0",
28-
"java-bigqueryreservation": "2.4.4",
29-
"java-billingbudgets": "2.3.4",
30-
"java-billing": "2.3.3",
31-
"java-binary-authorization": "1.2.7",
32-
"java-certificate-manager": "0.5.2",
33-
"java-channel": "3.7.4",
34-
"java-cloudbuild": "3.5.4",
35-
"java-cloudcommerceconsumerprocurement": "0.1.2",
26+
"java-bigquerydatatransfer": "2.3.15",
27+
"java-bigquerymigration": "0.6.2",
28+
"java-bigqueryreservation": "2.4.5",
29+
"java-billingbudgets": "2.3.6",
30+
"java-billing": "2.3.4",
31+
"java-binary-authorization": "1.2.8",
32+
"java-certificate-manager": "0.5.3",
33+
"java-channel": "3.7.6",
34+
"java-cloudbuild": "3.5.6",
35+
"java-cloudcommerceconsumerprocurement": "0.1.5",
3636
"java-compute": "1.12.1",
37-
"java-contact-center-insights": "2.3.6",
38-
"java-containeranalysis": "2.4.7",
39-
"java-container": "2.5.2",
40-
"java-datacatalog": "1.9.4",
41-
"java-dataflow": "0.7.4",
42-
"java-dataform": "0.2.2",
43-
"java-data-fusion": "1.3.3",
44-
"java-datalabeling": "0.123.5",
45-
"java-dataplex": "1.1.2",
46-
"java-dataproc-metastore": "2.4.3",
47-
"java-dataproc": "4.0.6",
48-
"java-datastream": "1.2.0",
49-
"java-debugger-client": "1.3.4",
37+
"java-contact-center-insights": "2.3.9",
38+
"java-containeranalysis": "2.4.9",
39+
"java-container": "2.6.0",
40+
"java-datacatalog": "1.9.5",
41+
"java-dataflow": "0.7.5",
42+
"java-dataform": "0.2.3",
43+
"java-data-fusion": "1.3.5",
44+
"java-datalabeling": "0.123.7",
45+
"java-dataplex": "1.1.3",
46+
"java-dataproc-metastore": "2.4.4",
47+
"java-dataproc": "4.0.7",
48+
"java-datastream": "1.2.1",
49+
"java-debugger-client": "1.3.5",
5050
"java-deploy": "1.1.6",
51-
"java-dialogflow-cx": "0.14.6",
52-
"java-dialogflow": "4.8.6",
53-
"java-dlp": "3.7.3",
54-
"java-dms": "2.2.5",
51+
"java-dialogflow-cx": "0.14.7",
52+
"java-dialogflow": "4.9.0",
53+
"java-dlp": "3.7.4",
54+
"java-dms": "2.2.7",
5555
"java-dns": "2.1.7",
56-
"java-document-ai": "2.7.2",
56+
"java-document-ai": "2.7.4",
5757
"java-domains": "1.0.4",
58-
"java-errorreporting": "0.124.11-beta",
59-
"java-essential-contacts": "2.3.4",
60-
"java-eventarc": "1.3.6",
61-
"java-eventarc-publishing": "0.3.4",
62-
"java-filestore": "1.4.3",
63-
"java-functions": "2.5.2",
64-
"java-game-servers": "2.3.3",
58+
"java-errorreporting": "0.124.14-beta",
59+
"java-essential-contacts": "2.3.5",
60+
"java-eventarc": "1.3.7",
61+
"java-eventarc-publishing": "0.3.6",
62+
"java-filestore": "1.4.5",
63+
"java-functions": "2.5.3",
64+
"java-game-servers": "2.3.4",
6565
"java-gke-backup": "0.2.4",
66-
"java-gke-connect-gateway": "0.4.5",
66+
"java-gke-connect-gateway": "0.4.6",
6767
"java-gkehub": "1.3.4",
6868
"java-gke-multi-cloud": "0.2.4",
69-
"java-grafeas": "2.4.5",
70-
"java-gsuite-addons": "2.3.4",
71-
"java-iam-admin": "1.2.5",
72-
"java-iamcredentials": "2.3.4",
73-
"java-ids": "1.2.4",
69+
"java-grafeas": "2.4.6",
70+
"java-gsuite-addons": "2.3.5",
71+
"java-iam-admin": "1.3.0",
72+
"java-iamcredentials": "2.3.6",
73+
"java-ids": "1.2.6",
7474
"java-iot": "2.3.4",
75-
"java-kms": "2.6.7",
76-
"java-language": "2.4.0",
77-
"java-life-sciences": "0.5.4",
78-
"java-managed-identities": "1.1.4",
79-
"java-mediatranslation": "0.9.4",
80-
"java-memcache": "2.3.4",
81-
"java-monitoring-dashboards": "2.5.4",
82-
"java-monitoring": "3.4.5",
83-
"java-networkconnectivity": "1.2.5",
75+
"java-kms": "2.6.8",
76+
"java-language": "2.4.1",
77+
"java-life-sciences": "0.5.5",
78+
"java-managed-identities": "1.1.5",
79+
"java-mediatranslation": "0.9.5",
80+
"java-memcache": "2.3.5",
81+
"java-monitoring-dashboards": "2.5.5",
82+
"java-monitoring": "3.4.6",
83+
"java-networkconnectivity": "1.2.8",
8484
"java-network-management": "1.4.2",
85-
"java-network-security": "0.6.2",
86-
"java-notebooks": "1.1.2",
87-
"java-notification": "0.123.15-beta",
88-
"java-optimization": "1.1.11",
89-
"java-orchestration-airflow": "1.3.4",
90-
"java-orgpolicy": "2.3.4",
91-
"java-os-config": "2.5.4",
92-
"java-os-login": "2.2.5",
93-
"java-phishingprotection": "0.34.4",
94-
"java-policy-troubleshooter": "1.2.4",
85+
"java-network-security": "0.6.3",
86+
"java-notebooks": "1.1.3",
87+
"java-notification": "0.123.16-beta",
88+
"java-optimization": "1.1.12",
89+
"java-orchestration-airflow": "1.3.5",
90+
"java-orgpolicy": "2.3.6",
91+
"java-os-config": "2.5.5",
92+
"java-os-login": "2.2.6",
93+
"java-phishingprotection": "0.34.6",
94+
"java-policy-troubleshooter": "1.2.5",
9595
"java-private-catalog": "0.5.3",
96-
"java-profiler": "2.3.3",
97-
"java-recaptchaenterprise": "3.0.9",
98-
"java-recommendations-ai": "0.10.3",
99-
"java-recommender": "2.5.4",
100-
"java-redis": "2.6.4",
101-
"java-resourcemanager": "1.5.5",
102-
"java-resource-settings": "1.3.3",
103-
"java-retail": "2.5.0",
104-
"java-run": "0.3.3",
105-
"java-scheduler": "2.3.11",
106-
"java-secretmanager": "2.3.7",
107-
"java-securitycenter": "2.10.0",
108-
"java-securitycenter-settings": "0.6.4",
109-
"java-security-private-ca": "2.5.3",
110-
"java-service-control": "1.3.3",
96+
"java-profiler": "2.3.4",
97+
"java-recaptchaenterprise": "3.0.11",
98+
"java-recommendations-ai": "0.10.4",
99+
"java-recommender": "2.5.6",
100+
"java-redis": "2.6.5",
101+
"java-resourcemanager": "1.5.6",
102+
"java-resource-settings": "1.3.4",
103+
"java-retail": "2.5.1",
104+
"java-run": "0.3.5",
105+
"java-scheduler": "2.3.12",
106+
"java-secretmanager": "2.3.10",
107+
"java-securitycenter": "2.11.0",
108+
"java-securitycenter-settings": "0.6.6",
109+
"java-security-private-ca": "2.5.4",
110+
"java-service-control": "1.3.4",
111111
"java-servicedirectory": "2.4.3",
112-
"java-service-management": "3.1.5",
113-
"java-service-usage": "2.3.4",
114-
"java-shell": "2.2.6",
112+
"java-service-management": "3.1.6",
113+
"java-service-usage": "2.3.6",
114+
"java-shell": "2.2.8",
115115
"java-speech": "2.5.9",
116-
"java-storage-transfer": "1.3.0",
117-
"java-talent": "2.4.4",
118-
"java-tasks": "2.3.10",
119-
"java-texttospeech": "2.4.4",
120-
"java-tpu": "2.3.5",
121-
"java-trace": "2.3.5",
122-
"java-translate": "2.3.4",
123-
"java-video-intelligence": "2.2.9",
124-
"java-video-live-stream": "0.5.4",
125-
"java-video-stitcher": "0.3.4",
116+
"java-storage-transfer": "1.3.1",
117+
"java-talent": "2.4.5",
118+
"java-tasks": "2.3.11",
119+
"java-texttospeech": "2.4.8",
120+
"java-tpu": "2.4.0",
121+
"java-trace": "2.3.7",
122+
"java-translate": "2.3.5",
123+
"java-video-intelligence": "2.2.12",
124+
"java-video-live-stream": "0.5.7",
125+
"java-video-stitcher": "0.3.5",
126126
"java-video-transcoder": "1.2.3",
127-
"java-vision": "3.1.1",
128-
"java-vmmigration": "1.3.2",
129-
"java-vpcaccess": "2.4.0",
130-
"java-webrisk": "2.2.4",
131-
"java-websecurityscanner": "2.2.4",
132-
"java-workflow-executions": "2.3.4",
133-
"java-workflows": "2.3.4"
134-
}
127+
"java-vision": "3.1.2",
128+
"java-vmmigration": "1.3.4",
129+
"java-vpcaccess": "2.4.2",
130+
"java-webrisk": "2.2.5",
131+
"java-websecurityscanner": "2.3.0",
132+
"java-workflow-executions": "2.3.5",
133+
"java-workflows": "2.3.5"
134+
}
Lines changed: 40 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,60 @@
11
#!/bin/bash
22

3-
set -xe
3+
set -e
44

5-
echo "{" > .release-please-manifest.json
5+
GENERATION_DIR=$(dirname -- "$0")
66

7-
echo ""\""google-cloud-gapic-bom"\"": "\""0.0.0"\""," >> .release-please-manifest.json
7+
# Hardcode the tab as two spaces instead of \t
8+
tab=" "
9+
release_please_manifest_file=".release-please-manifest.json"
10+
release_please_config_file="release-please-config.json"
811

9-
GENERATION_DIR=$(dirname -- "$0");
12+
[ -e "${release_please_manifest_file}" ] && rm "${release_please_manifest_file}"
13+
[ -e "${release_please_config_file}" ] && rm "${release_please_config_file}"
1014

11-
num_modules=$(find . -mindepth 2 -maxdepth 2 -name pom.xml | wc -l)
12-
13-
rp_config_line=""
14-
rp_manifest_line=""
15+
echo "{" > "${release_please_manifest_file}"
1516

16-
for module in $(find . -mindepth 2 -maxdepth 2 -name pom.xml |sort | xargs dirname); do
17-
18-
if [[ "${module}" = *google-cloud-gapic-bom ]] || [[ "${module}" = *CoverageAggregator ]]; then
17+
# We are manually excluding the CoverageAggregator module -- TODO: Update this for any other exclusions
18+
num_modules=$(find . -mindepth 2 -maxdepth 2 -name pom.xml | wc -l)
19+
num_modules=$((num_modules - 1))
20+
for path in $(find . -mindepth 2 -maxdepth 2 -name pom.xml | sort --dictionary-order | xargs dirname); do
21+
if [[ "${path}" = *CoverageAggregator ]]; then
1922
continue
2023
fi
2124

22-
version_file="${module}/versions.txt"
25+
# path starts with ./{module}, we need to exclude the first two chars
26+
module_name="${path:2}"
27+
version_file="${path}/versions.txt"
2328

24-
module_name="${module:2}"
25-
26-
module_released_version=$(grep google- ${version_file} |head -1 |awk -F: '{print $2}')
27-
module_snapshot_version=$(grep google- ${version_file} |head -1 |awk -F: '{print $3}')
28-
artifactName_config=$(grep google- ${version_file} |head -1 |awk -F: '{print $1}')
29-
30-
#specific case
31-
if [[ ${module_name} == "java-grafeas" ]]; then
32-
module_released_version=$(grep grafeas ${version_file} |head -1 |awk -F: '{print $2}')
33-
artifactName_config=$(grep grafeas ${version_file} |head -1 |awk -F: '{print $1}')
29+
# Java-Grafeas is a special case
30+
if [[ "${module_name}" = "java-grafeas" ]]; then
31+
module_line=$(grep -E "^grafeas:[0-9]+\.[0-9]+\.[0-9]+.*:[0-9]+\.[0-9]+\.[0-9]+.*$" "${version_file}")
32+
else
33+
module_line=$(grep -E "^google-.*:[0-9]+\.[0-9]+\.[0-9]+.*:[0-9]+\.[0-9]+\.[0-9]+.*$" "${version_file}")
3434
fi
35+
artifact_name=$(echo "${module_line}" | cut -d ":" -f1)
36+
module_released_version=$(echo "${module_line}" | cut -d ":" -f2)
37+
module_snapshot_version=$(echo "${module_line}" | cut -d ":" -f3)
3538

36-
#concatenating module name and module version
37-
rp_manifest_line=""\""${module_name}"\"": "\""${module_released_version}"\"""
39+
# concatenating module name and module version
40+
rp_manifest_line="${tab}\"${module_name}\": \"${module_released_version}\""
41+
# Generate the JSON block with formatting
42+
rp_config_line+="${tab}${tab}\"${module_name}\": {\n${tab}${tab}${tab}\"component\": \"${artifact_name}\",\n${tab}${tab}${tab}\"skip-github-release\": true\n${tab}${tab}}"
3843

39-
rp_config_line+=""\""${module_name}"\"": {\n\
40-
"\""component"\"": ""\""${artifactName_config}"\"","\n\
41-
"\""skip-github-release"\"": "true"\n\
42-
}"
43-
44-
#adding " , " where it's necessary
45-
if [[ ${num_modules} -gt 2 ]]; then
44+
# adding " , " where it's necessary
45+
if [[ ${num_modules} -gt 1 ]]; then
4646
rp_manifest_line+=","
47-
rp_config_line+=",\n "
48-
num_modules=$((num_modules-1))
47+
rp_config_line+=",\n"
48+
num_modules=$((num_modules - 1))
4949
fi
5050

51-
#adding the line to manifest config file
52-
echo "${rp_manifest_line}" >> .release-please-manifest.json
53-
54-
#for multi-module libraries, sync the versions to released(non-snapshot):current(snapshot) type
55-
cat ${version_file} | while read line
56-
do
57-
if [[ ${line} =~ [0-9] ]] && ! [[ ${line} == *"SNAPSHOT"* ]] ; then
58-
artifact_name=$(echo "${line}" | awk -F':' '{print $1}')
59-
old_version=$(echo "${line}" | awk -F':' '{print $3}')
60-
new_version=$(echo ${old_version} | awk -F'.' '{print $1"."$2"."$3+1}' | sed s/[.]$//)
61-
new_version="${new_version}-SNAPSHOT"
62-
sed -i.bak -e "s|${artifact_name}:${old_version}:${old_version}|${artifact_name}:${old_version}:${new_version}|" "${version_file}" && rm "${version_file}".bak
63-
fi
64-
done
51+
# Adding the line to manifest config file
52+
echo -e "${rp_manifest_line}" >> "${release_please_manifest_file}"
6553
done
6654

67-
echo "}" >> .release-please-manifest.json
55+
# End the .json file with the closing bracket
56+
echo "}" >> "${release_please_manifest_file}"
6857

69-
awk -v "packagesList=$rp_config_line" '{gsub(/ALL_PACKAGES/,packagesList)}1' \
70-
${GENERATION_DIR}/release_please_config_raw.json > release-please-config.json
58+
# Replace the package list where `ALL_PACKAGES` string is in the release_please_config_raw.json
59+
awk -v "packagesList=${rp_config_line}" '{gsub(/ALL_PACKAGES/,packagesList)}1' \
60+
"${GENERATION_DIR}/release_please_config_raw.json" > "${release_please_config_file}"

‎generation/release_please_config_raw.json‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
"separate-pull-requests": false,
55
"include-component-in-tag": true,
66
"packages": {
7-
"google-cloud-gapic-bom": {
8-
"component": "google-cloud-gapic-bom",
9-
"skip-github-release": true
10-
},
11-
ALL_PACKAGES
7+
ALL_PACKAGES
128
},
139
"plugins": [
1410
"maven-workspace"

‎generation/update_versions.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,11 @@ for path in $(find . -mindepth 2 -maxdepth 2 -name pom.xml | sort | xargs dirnam
118118
done
119119

120120
echo "These artifacts don't exist: ${missing_artifacts[*]}"
121+
122+
echo "Generating the release-please configurations..."
123+
./generation/generate_release_please_config.sh
124+
echo "Done generating release-please configurations..."
125+
126+
echo "Copying over the README and CHANGELOG files"
127+
./generation/copy_readme_changelog.sh
128+
echo "Done copying over the README and CHANGELOG files"

‎java-accessapproval/versions.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Format:
22
# module:released-version:current-version
33

4-
google-cloud-accessapproval:2.4.8:2.4.9-SNAPSHOT
5-
grpc-google-cloud-accessapproval-v1:2.4.8:2.4.9-SNAPSHOT
6-
proto-google-cloud-accessapproval-v1:2.4.8:2.4.9-SNAPSHOT
4+
google-cloud-accessapproval:2.4.9:2.4.10-SNAPSHOT
5+
grpc-google-cloud-accessapproval-v1:2.4.9:2.4.10-SNAPSHOT
6+
proto-google-cloud-accessapproval-v1:2.4.9:2.4.10-SNAPSHOT

0 commit comments

Comments
 (0)