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

Cannot ignore internal package #833

Open
Jack-Works opened this issue Jun 8, 2022 · 4 comments · May be fixed by #919 or #1231
Open

Cannot ignore internal package #833

Jack-Works opened this issue Jun 8, 2022 · 4 comments · May be fixed by #919 or #1231

Comments

@Jack-Works
Copy link

Affected Packages

Changesets cli

Problem

I have "ignore": ["install-swc-plugin-test"] in .changeset/config.json, and packages/swc-plugin-test/package.json also marked as private: true and with no version field.

But when I run npx changesets tag, it always includes this package.

~/../aot-secure-ecmascript main  ≡  npx changeset tag
🦋  Skipping tag (already exists):  @masknet/compartment@0.1.0
🦋  Skipping tag (already exists):  @masknet/static-module-record-swc@0.2.1
🦋  Skipping tag (already exists):  install-swc-plugin-test@undefined

Repo: https://github.com/DimensionDev/aot-secure-ecmascript

It fails our CI every release because install-swc-plugin-test@undefined is a duplicated git tag.

CI log:

🦋  New tag:  @masknet/compartment@0.1.0
🦋  New tag:  @masknet/static-module-record-swc@0.2.1
🦋  New tag:  install-swc-plugin-test@undefined
🦋  info npm info @masknet/compartment
🦋  info npm info @masknet/static-module-record-swc
🦋  warn Received 404 for npm info "@masknet/compartment"
🦋  info @masknet/compartment is being published because our local version (0.1.0) has not been published on npm
🦋  warn @masknet/static-module-record-swc is not being published because version 0.2.1 is already published on npm
🦋  info Publishing "@masknet/compartment" at "0.1.0"
🦋  success packages published successfully:
🦋  @masknet/compartment@0.1.0
🦋  Creating git tag...
🦋  New tag:  @masknet/compartment@0.1.0
/usr/bin/git push origin --tags
To https://github.com/DimensionDev/aot-secure-ecmascript
 * [new tag]         @masknet/compartment@0.1.0 -> @masknet/compartment@0.1.0
 * [new tag]         @masknet/static-module-record-swc@0.2.1 -> @masknet/static-module-record-swc@0.2.1
 ! [rejected]        install-swc-plugin-test@undefined -> install-swc-plugin-test@undefined (already exists)
error: failed to push some refs to 'https://github.com/DimensionDev/aot-secure-ecmascript'
hint: Updates were rejected because the tag already exists in the remote.

Proposed solution

Ignore the internal package that is not intended to publish anyway.

@Jack-Works
Copy link
Author

I find out a workaround. When checkout the repo on CI, you should check out all commits and tags so that the changeset can skip the duplicated tags.

image

@Andarist
Copy link
Member

Andarist commented Aug 5, 2022

I think that the proper fix would be to filter the packages here:
https://github.com/changesets/changesets/blob/0fd56e17092c7258de57adf7dd4ba08406c8e440/packages/cli/src/commands/tag/index.ts
in the same way they are filtered here:

return (
!config.ignore.includes(packageJson.name) &&
(packageJson.version || !packageJson.private)
);

@Jack-Works
Copy link
Author

I believe this is fixed by #720?

@Andarist
Copy link
Member

Andarist commented Aug 5, 2022

Nope - this PR has only fixed an issue with packages like that being listed in the CLI prompt when adding a changeset. You’d like to have this fixed for changeset tag

jjangga0214 added a commit to jjangga0214/changesets that referenced this issue Aug 17, 2022
jjangga0214 added a commit to jjangga0214/changesets that referenced this issue Aug 17, 2022
@jjangga0214 jjangga0214 linked a pull request Aug 17, 2022 that will close this issue
jjangga0214 added a commit to jjangga0214/changesets that referenced this issue Aug 17, 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
2 participants