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

WIP: individual publishing of packages #2289

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Dec 10, 2024

No description provided.

@gagik gagik force-pushed the gagik/individual-publishing branch from 879eb0f to 40d6e71 Compare December 10, 2024 11:17
@gagik gagik force-pushed the gagik/individual-publishing branch from f48cc5c to a2f246b Compare December 18, 2024 12:05
lerna.json Show resolved Hide resolved
],
"version": "0.0.0-dev.0"
"packages": ["configs/*", "packages/*", "scripts/docker"],
"version": "independent"
Copy link
Contributor Author

@gagik gagik Dec 18, 2024

Choose a reason for hiding this comment

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

@addaleax I'm a bit unsure how to go about all this to the point where I can feel much confidence;
What I did here is

  1. remove lerna force publish
  2. use lerna independent mode
  3. add the bump script
    I feel like this should hypothetically do the trick. maybe a couple more changes might be all we need.

I tried i.e. running npm run bump-packages locally and I wonder if it is because of the fact that this PR itself technically changes all of the packages, we end up with a bunch of bumps; some reasonable others not so much.

I assume some of these packages we'd like to ignore right? And also some which we should keep at 0.0.0-dev.0 for our development?

Copy link
Contributor

Choose a reason for hiding this comment

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

I assume some of these packages we'd like to ignore right? And also some which we should keep at 0.0.0-dev.0 for our development?

Well, the mongosh and @mongosh/cli-repl packages specifically should still be bumped as part of the process we have now, that can be by using the 0.0.0-dev.0 placeholders but I don't think that's a strict requirement here

packages/snippet-manager/package.json Outdated Show resolved Hide resolved
@@ -20,10 +20,6 @@ export function publishNpmPackages(
);
}

if (versions[0] === PLACEHOLDER_VERSION) {
throw new Error('Refusing to publish packages with placeholder version');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we're dropping this because we're assuming that a placeholder version wouldn't ever be used anyway?

Copy link
Contributor Author

@gagik gagik Dec 19, 2024

Choose a reason for hiding this comment

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

that was my thinking though I am wondering if it'd be useful in some manner; the only thing I can think of is if we want to opt-out a package from being versioned independently; but keeping an opt-out list would make more sense in that case

// updates the version of internal packages to reflect the tagged one
await bumpNpmPackages(config.version);
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This release process should still involve a bump of the versions of all packages that the @mongosh/cli-repl package depends on, right?

Copy link
Contributor Author

@gagik gagik Dec 19, 2024

Choose a reason for hiding this comment

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

Hm right, was going to make this part of a script but re-added it as a function which calls the bump-packages.

So an idea could be:

  1. At release, for mongosh and @mongosh/cli-repl, the version is manually set at config.version from release before the rest of the packages get bumped.
  2. We bump all other packages with bump-packages at release except mongosh and @mongosh/cli-repl which will always be excluded from bump-packages, including when running it from a bump action.

Would this make sense with what we're going for?

],
"version": "0.0.0-dev.0"
"packages": ["configs/*", "packages/*", "scripts/docker"],
"version": "independent"
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume some of these packages we'd like to ignore right? And also some which we should keep at 0.0.0-dev.0 for our development?

Well, the mongosh and @mongosh/cli-repl packages specifically should still be bumped as part of the process we have now, that can be by using the 0.0.0-dev.0 placeholders but I don't think that's a strict requirement here

@gagik gagik force-pushed the gagik/individual-publishing branch from 8c9c214 to 41bc10a Compare December 20, 2024 14:55
@gagik
Copy link
Contributor Author

gagik commented Dec 20, 2024

@addaleax Didn't get to spend too much time on this before my holiday with some VSCode and coverage test back and forths. Would be happy to jump back into it in a week but if it'd be better to finish this earlier, feel free to pick it up 🙂 I have some WIP files that I may polish up and push at a later time also though not sure how useful they are; will see.

@gagik gagik force-pushed the gagik/individual-publishing branch from 41bc10a to ad630dc Compare December 30, 2024 11:48
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