Skip to content

Run sync as part of astro check#5823

Merged
delucis merged 5 commits into
mainfrom
chris/sync-in-check
Jan 11, 2023
Merged

Run sync as part of astro check#5823
delucis merged 5 commits into
mainfrom
chris/sync-in-check

Conversation

@delucis
Copy link
Copy Markdown
Member

@delucis delucis commented Jan 10, 2023

Changes

Sites using content collections will usually need their generated types for astro check to pass. This PR runs the sync command at the start of the check script to avoid users needing to always do astro sync && astro check (especially in CI where generated types are less likely to already be present).

@bholmesdev Is astro sync a safe no-op if no content collections are configured?

For context: this is already an issue for #5765 where astro check is failing in our CI because content types aren’t generated. The other approach would be to only fix this in our CI script but given other users might run into this, I thought this combo would make most sense.

Testing

No additional testing just yet. Running pnpm test:match "check" passes but only shows two relevant tests currently.

Docs

No docs needed I don’t think?

@delucis delucis requested a review from Princesseuh January 10, 2023 22:56
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 10, 2023

🦋 Changeset detected

Latest commit: f20e515

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Jan 10, 2023
@github-actions github-actions Bot added the semver: minor Change triggers a `minor` release label Jan 10, 2023
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

Copy link
Copy Markdown
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

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

Since we do this already on dev and build, might as well. If it ever becomes a problem, we could have a --no-sync flag or something similar. +1 from the astro check end of things!

Copy link
Copy Markdown
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

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

Small comment but this PR checks out. Also +1 to Erika's comment on adding a --no-sync or --skip-sync flag if users request it

Comment thread packages/astro/src/cli/check/index.ts Outdated
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@delucis delucis dismissed github-actions[bot]’s stale review January 11, 2023 16:39

Shhh… we’re in prerelease mode

@delucis delucis merged commit 1f49cdd into main Jan 11, 2023
@delucis delucis deleted the chris/sync-in-check branch January 11, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants