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

chore: update close-invalid-link.js #5467

Merged
merged 1 commit into from
Jun 14, 2024
Merged

chore: update close-invalid-link.js #5467

merged 1 commit into from
Jun 14, 2024

Conversation

sofisl
Copy link
Contributor

@sofisl sofisl commented Jun 13, 2024

This action passed, because there was a github link... in the template of the bug. This updates the logic so we're specifically looking where it should be inputted.

@sofisl sofisl requested review from yoshi-approver and a team as code owners June 13, 2024 20:32
Copy link

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@@ -35,7 +35,7 @@ module.exports = async ({ github, context }) => {

if (isBugTemplate) {
try {
const link = issue.data.body.match(/(https?:\/\/github.com\/.*)/)[0];
const link = issue.data.body.split("\n")[18].match(/(https?:\/\/g?i?s?t\.?github.com\/.*)/);
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems sensitive to subtle changes; e.g. a minor change in the bug template could break the 18 positioning and would be difficult to debug. Perhaps a .matchAll with URL parsing would work more consistently for the long-term: https://github.com/googleapis/google-cloud-node/pull/5460/files#r1637082948

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True - not ideal. However your solution would fail (pass?) for the same reason, i.e., it would catch github links in the template. I think, ultimately, we need to check the input value itself. Ideally github would provide a JSON-like object for their yaml templates, especially since they support required fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sofisl sofisl requested a review from danielbankhead June 14, 2024 05:42
@sofisl sofisl merged commit 889151e into main Jun 14, 2024
10 of 11 checks passed
@sofisl sofisl deleted the sofisl-patch-9 branch June 14, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants