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

Prevent invalid links in update task script #316

Merged

Conversation

alistairjcbrown
Copy link
Member

Reviewer: @GioSensation
Asana: https://app.asana.com/0/1198964220583541/1204575576128585/f

Description

Asana rejected input with invalid href values for links, which this script was previously doing whenever the PR URL was missing. Update this fail gracefully.

Failure example: https://github.com/duckduckgo/duckduckgo-autofill/actions/runs/4938719133/jobs/8828855242
image

Steps to test

Unit test included

Asana rejected input with invalid href values for links, which this
script was previously doing whenever the PR URL was missing. Update this
fail gracefully.
const markup =
`${wrapInLi(getLink(prUrls.ios, 'iOS PR'))}${wrapInLi(getLink(prUrls.macos, 'macOS PR'))}`
taskDescriptionSubstitutions.push(
[/\[\[extra_content]]/, markup]
Copy link
Member Author

Choose a reason for hiding this comment

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

Let me know if I've made a mistake here, but it seemed strange that here we didn't replace the wrapping <li>, but below we did -- surely we'd want to replace it both times? (either to replace it with the two bullet points created above, or to remove it completely)

Copy link
Member

Choose a reason for hiding this comment

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

Mhm, not 100% sure, but we'll see when it runs.

Copy link
Member

@GioSensation GioSensation left a comment

Choose a reason for hiding this comment

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

Nice work. Love that you added tests.

const markup =
`${wrapInLi(getLink(prUrls.ios, 'iOS PR'))}${wrapInLi(getLink(prUrls.macos, 'macOS PR'))}`
taskDescriptionSubstitutions.push(
[/\[\[extra_content]]/, markup]
Copy link
Member

Choose a reason for hiding this comment

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

Mhm, not 100% sure, but we'll see when it runs.

@alistairjcbrown alistairjcbrown merged commit 5ebeb5f into main May 15, 2023
@alistairjcbrown alistairjcbrown deleted the abrown/prevent-invalid-links-in-update-task-script branch May 15, 2023 10:07
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