Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update PHP tags #518

Merged
merged 4 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions releasetool/commands/tag/php.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ def kokoro_job_name(upstream_repo: str, package_name: str) -> Union[str, None]:
repo_short_name = upstream_repo.split("/")[-1]

if repo_short_name == "google-cloud-php":
return "cloud-devrel/client-libraries/php/google-cloud-php/docs/docs"

return "cloud-devrel/client-libraries/php/google-cloud-php/docs"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, this should not have been updated... the correct URL is /docs/docs

else:
return None
return f"cloud-devrel/client-libraries/php/{upstream_repo}/release"


def package_name(pull: dict) -> Union[str, None]:
Expand Down
7 changes: 6 additions & 1 deletion tests/commands/tag/test_tag_php.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@

def test_kokoro_job_name():
job_name = kokoro_job_name("upstream-owner/upstream-repo", "some-package-name")
assert job_name is None
assert (
job_name
== "cloud-devrel/client-libraries/php/upstream-owner/upstream-repo/release"
)
job_name = kokoro_job_name("upstream-owner/google-cloud-php", "some-package-name")
assert job_name == "cloud-devrel/client-libraries/php/google-cloud-php/docs"


def test_package_name():
Expand Down
21 changes: 0 additions & 21 deletions tests/test_autorelease_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,6 @@ def test_trigger_kokoro_build_for_pull_request_skips_kokoro_if_not_in_allowlist(
trigger_build.assert_not_called()


@patch("autorelease.trigger.LANGUAGE_ALLOWLIST", ["php"])
@patch("autorelease.kokoro.trigger_build")
def test_trigger_kokoro_build_for_pull_request_skips_kokoro_if_no_job_name(
trigger_build,
):
github = Mock()
github.get_url.return_value = {
"merged_at": "2021-01-01T09:00:00.000Z",
"base": {"repo": {"full_name": "googleapis/google-cloud-php-bigquery"}},
"html_url": "https://github.com/googleapis/google-cloud-php-bigquery/pulls/5",
}
issue = {
"pull_request": {
"url": "https://api.github.com/googleapis/google-cloud-php-bigquery/pull/5"
},
"merged_at": "2021-01-01T09:00:00.000Z",
}
trigger.trigger_kokoro_build_for_pull_request(Mock(), github, issue, Mock())
trigger_build.assert_not_called()


@patch("autorelease.trigger.LANGUAGE_ALLOWLIST", ["php"])
@patch("autorelease.kokoro.trigger_build")
def test_trigger_kokoro_build_for_pull_request_skips_kokoro_if_already_triggered(
Expand Down