Skip to content

Cleanup @changesets/git tests - #1029

Merged
Andarist merged 5 commits into
mainfrom
cleanup-git-pkg-tests
Dec 14, 2022
Merged

Andarist merged 5 commits into
mainfrom
cleanup-git-pkg-tests

Conversation

@Andarist

@Andarist Andarist commented Dec 12, 2022 •

Copy link
Copy Markdown
Member

This PR:

  • removes beforeEach hooks in favor of explicit setup per test
  • unifies all methods to work on full commit SHAs by default (this wasn't consistent and it created annoying issues in tests when comparing full and short SHAs of the same commit). You can still request a short SHA explicitly from getCurrentCommitId

TODO:

  • add appropriate changesets for the @changesets/git package since the second change could be seen as a breaking change

@Andarist
Andarist requested review from chaance and emmatown December 12, 2022 13:31
@changeset-bot

changeset-bot Bot commented Dec 12, 2022 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: adf66bd

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

This PR includes changesets to release 6 packages
Name Type
@changesets/git Major
@changesets/apply-release-plan Patch
@changesets/cli Patch
@changesets/read Patch
@changesets/release-utils Patch
@changesets/get-release-plan Patch

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

@codesandbox-ci

codesandbox-ci Bot commented Dec 12, 2022 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit adf66bd:

Sandbox Source
Vanilla Configuration

@Andarist
Andarist force-pushed the cleanup-git-pkg-tests branch from 71bbe7a to 9a19bcc Compare December 12, 2022 13:44

@emmatown emmatown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems fine besides missing missing changesets

@chaance chaance left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good overall. Just wondering if we need a changeset to top it off.

Comment thread packages/git/src/index.ts
export async function getCommitsThatAddFiles(
gitPaths: string[],
cwd: string
{ cwd, short = false }: { cwd: string; short?: boolean }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this is exposed API, should we include a changeset to document it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeap, gonna add changesets before merging this - a few minor breaking changes got included here as part of the refactor.

@Andarist
Andarist merged commit 598136a into main Dec 14, 2022
@Andarist
Andarist deleted the cleanup-git-pkg-tests branch December 14, 2022 23:08
@github-actions github-actions Bot mentioned this pull request Dec 14, 2022
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.

3 participants