|
27 | 27 | from releasetool.commands.common import TagContext |
28 | 28 |
|
29 | 29 |
|
| 30 | +# Standard Ruby repos in the googleapis org |
| 31 | +RUBY_CLIENT_REPOS = [ |
| 32 | + "common-protos-ruby", |
| 33 | + "gapic-generator-ruby", |
| 34 | + "google-api-ruby-client", |
| 35 | + "google-auth-library-ruby", |
| 36 | + "google-cloud-ruby", |
| 37 | + "ruby-cloud-env", |
| 38 | + "ruby-spanner-activerecord", |
| 39 | + "ruby-style", |
| 40 | + "signet", |
| 41 | +] |
| 42 | + |
| 43 | +# Standard Ruby repos in the GoogleCloudPlatform org |
| 44 | +RUBY_CLOUD_REPOS = [ |
| 45 | + "appengine-ruby", |
| 46 | + "functions-framework-ruby", |
| 47 | + "serverless-exec-ruby", |
| 48 | +] |
| 49 | + |
| 50 | +# Standard Ruby monorepos with gems located in subdirectories |
| 51 | +RUBY_MONO_REPOS = [ |
| 52 | + "common-protos-ruby", |
| 53 | + "gapic-generator-ruby", |
| 54 | + "google-api-ruby-client", |
| 55 | + "google-cloud-ruby", |
| 56 | +] |
| 57 | + |
| 58 | + |
30 | 59 | def determine_release_pr(ctx: TagContext) -> None: |
31 | 60 | click.secho( |
32 | 61 | "> Let's figure out which pull request corresponds to your release.", fg="cyan" |
@@ -82,13 +111,10 @@ def determine_package_name_and_version(ctx: TagContext) -> None: |
82 | 111 |
|
83 | 112 | def get_release_notes(ctx: TagContext) -> None: |
84 | 113 | click.secho("> Grabbing the release notes.", fg="cyan") |
85 | | - if ( |
86 | | - "google-cloud-ruby" in ctx.upstream_repo |
87 | | - or "google-api-ruby-client" in ctx.upstream_repo |
88 | | - ): |
89 | | - changelog_file = f"{ctx.package_name}/CHANGELOG.md" |
90 | | - else: |
91 | | - changelog_file = "CHANGELOG.md" |
| 114 | + changelog_file = "CHANGELOG.md" |
| 115 | + for name in RUBY_MONO_REPOS: |
| 116 | + if name in ctx.upstream_repo: |
| 117 | + changelog_file = f"{ctx.package_name}/CHANGELOG.md" |
92 | 118 | changelog = ctx.github.get_contents( |
93 | 119 | ctx.upstream_repo, changelog_file, ref=ctx.release_pr["merge_commit_sha"] |
94 | 120 | ).decode("utf-8") |
@@ -141,33 +167,18 @@ def kokoro_job_name(upstream_repo: str, package_name: str) -> Union[str, None]: |
141 | 167 | The name of the Kokoro job to trigger or None if there is no job to trigger |
142 | 168 | """ |
143 | 169 |
|
144 | | - RUBY_CLIENT_REPOS = [ |
145 | | - "common-protos-ruby", |
146 | | - "gapic-generator-ruby", |
147 | | - "google-auth-library-ruby", |
148 | | - "google-cloud-ruby", |
149 | | - "ruby-cloud-env", |
150 | | - "ruby-spanner-activerecord", |
151 | | - "ruby-style", |
152 | | - "signet", |
153 | | - ] |
154 | | - |
155 | | - RUBY_CLOUD_REPOS = [ |
156 | | - "appengine-ruby", |
157 | | - "functions-framework-ruby", |
158 | | - "serverless-exec-ruby", |
159 | | - ] |
| 170 | + # TODO(dazuma): Remove once this repo uses the standard release jobs |
| 171 | + if "google-api-ruby-client" in upstream_repo: |
| 172 | + return f"cloud-devrel/client-libraries/google-api-ruby-client/release/{package_name}" |
160 | 173 |
|
161 | 174 | for name in RUBY_CLIENT_REPOS: |
162 | 175 | if name in upstream_repo: |
163 | 176 | return f"cloud-devrel/client-libraries/{name}/release" |
164 | 177 | for name in RUBY_CLOUD_REPOS: |
165 | 178 | if name in upstream_repo: |
166 | 179 | return f"cloud-devrel/ruby/{name}/release" |
167 | | - if "google-api-ruby-client" in upstream_repo: |
168 | | - return f"cloud-devrel/client-libraries/google-api-ruby-client/release/{package_name}" |
169 | | - else: |
170 | | - return f"cloud-devrel/client-libraries/{package_name}/release" |
| 180 | + |
| 181 | + return f"cloud-devrel/client-libraries/{package_name}/release" |
171 | 182 |
|
172 | 183 |
|
173 | 184 | def package_name(pull: dict) -> Union[str, None]: |
|
0 commit comments