Skip to content

✨ Accept sitemaps with the snapshot command!#516

Merged
wwilsman merged 2 commits intomasterfrom
ww/snapshot-sitemap
Aug 20, 2021
Merged

✨ Accept sitemaps with the snapshot command!#516
wwilsman merged 2 commits intomasterfrom
ww/snapshot-sitemap

Conversation

@wwilsman
Copy link
Copy Markdown
Contributor

What is this?

This makes it possible to use percy snapshot <sitemap-url> to take snapshots of all of the URLs listed by a sitemap.

The changes in the PR leverage the existing mapStaticSnapshots util, thus allowing include, exclude, and overrides. Technically, this util also allows a couple of other static options, however those options (such as rewrites and base-url) are not necessary as URLs within a sitemap are typically canonical URLs.

If a fetched sitemap is not an XML document, an error will be thrown. In the future, it's possible this can be relaxed a little since our regexp parser doesn't necessarily need valid XML to work (it simply matches URLs between XML <loc> tags).

I also discovered that some sitemaps list a URL twice, with and without a trailing forward slash (/). This prompted a filter to remove such duplicate URLs.

Not many tests were necessary for this since it leverages existing utils.

@wwilsman wwilsman added the ✨ enhancement New feature or request label Aug 20, 2021
@wwilsman wwilsman requested a review from Robdel12 August 20, 2021 20:42
@wwilsman wwilsman enabled auto-merge (squash) August 20, 2021 20:48
Copy link
Copy Markdown
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

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

🏁 super fun times! Great stuff

@wwilsman wwilsman merged commit f4bee79 into master Aug 20, 2021
@wwilsman wwilsman deleted the ww/snapshot-sitemap branch August 20, 2021 21:09
samarsault pushed a commit that referenced this pull request Mar 3, 2023
Bumps [cypress](https://github.com/cypress-io/cypress) from 10.2.0 to 10.3.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](cypress-io/cypress@v10.2.0...v10.3.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants