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

fix: refine regex used to identify asset links #1055

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dcshzj
Copy link
Contributor

@dcshzj dcshzj commented Jan 28, 2025

Problem

The regex used to identify asset links is too general, which can give false positives when the root folder's permalink is just numbers.

Solution

Breaking Changes

  • Yes - this PR contains breaking changes
  • No - this PR is backwards compatible

Bug Fixes:

  • Properly detect asset links by including the UUID v4 portion as part of the asset links regex.

Tests

  • Go to Studio and create a root level folder with just numbers in the permalink (e.g. 2024)
  • Create a page within this new folder using any name/permalink and save.
  • Inside a separate page, create a link to this newly created page and publish.
  • Verify that the link is indeed pointing to the newly created page from the second page that you edited.

@dcshzj dcshzj requested a review from a team as a code owner January 28, 2025 01:36
@datadog-opengovsg
Copy link

datadog-opengovsg bot commented Jan 28, 2025

Datadog Report

Branch report: fix/refine-asset-regex
Commit report: 9d0d133
Test service: isomer-studio

✅ 0 Failed, 266 Passed, 36 Skipped, 45.53s Total Time
⬆️ Test Sessions change in coverage: 1 increased (+1.59%)

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