-
Notifications
You must be signed in to change notification settings - Fork 36
chore(ci): add publish workflows for monorepo W-19398854 #162
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
Conversation
[skip ci]
[skip ci]
Auto-update dependency after provider package publish. Related release: mcp-provider-dx-core@0.1.2
Auto-update dependency after provider package publish. Related release: mcp-provider-code-analyzer@0.0.1
[skip ci]
paths: | ||
- 'packages/mcp-provider-api/**' | ||
- 'packages/mcp-provider-dx-core/**' | ||
# - 'packages/mcp-provider-code-analyzer/**' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change this to 'packages/mcp-provider-*/**
? That way new teams do not need to add new paths here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nevermind. Down below we have an array of packages. So instead we need to uncomment - 'packages/mcp-provider-code-analyzer/**
here and then add some documentation on adding a new provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So instead we need to uncomment - 'packages/mcp-provider-code-analyzer/** here and then add some documentation on adding a new provider
it's commented out on purpose, the automated release is only enabled for the provider-api and dx-core modules because we own them but code-analyzer might want to have their own release cadence (manual release).
For instance, CA folks might be working on features for 2 weeks and merging stuff into main
but without releasing that package, so if we need to trigger a server release during that time they are safe because @salesforce/mcp
will be referring to their last published npm pkg.
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for the future: We may want to use https://github.com/salesforcecli/github-workflows/blob/main/.github/actions/yarnInstallWithRetries/action.yml
We could add a --frozen-lockfile
input
cd packages/mcp | ||
jq --arg pkg "$PACKAGE_NAME" --arg ver "^$PUBLISHED_VERSION" \ | ||
'.dependencies[$pkg] = $ver' package.json > package.json.tmp | ||
mv package.json.tmp package.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mv
need a -f
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, I see the release commits are right after this file rename.
fwiw, this is just a workaround due to a dependency issue that blocks us from doing yarn add ...
(it fails due to eslint v8 and v9 issues)
cd ../../ | ||
# TODO(cristian): need to nuke all `node_modules` to cleanup some dep, running `yarn install` 2 times fails at the second run. | ||
git clean -fdx | ||
yarn install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for the future: We may want to add a npx yarn-deduplicate && yarn install
here
[skip ci] Co-authored-by: Willhoit <iowillhoit@users.noreply.github.com>
[skip ci] Co-authored-by: Willhoit <iowillhoit@users.noreply.github.com>
[skip ci] Co-authored-by: Willhoit <iowillhoit@users.noreply.github.com>
29b451c
to
9efee53
Compare
What does this PR do?
Adds publishing workflows for the new monorepo structure (the current ones on main are disabled bc they only work on single repos).
Out of scope:
General overview
We have yarn v1 monorepo with the following structure of packages:
where:
mcp
is the main DX MCP servermcp-provider-api
is the lib that provider implementers consumemcp-provider-*
are the DX MCP providers that live inside our monorepoEXAMPLE-MCP-PROVIDER
: example code only, no need to publish itThe top-level
package.json
is just for the monorepo organization and doesn't get published.Release strategy
mcp
consumes providers as npm packages, so if you make a change in thedx-core
provider and want to release that you need to:dx-core
provider to npm with your changepackages/mcp/package.json
and do a server release.NOTE: same applies to providers outside the monorepo (lwc, mobile, etc)
DX MCP Server
This is a manual process that you can trigger by running the
publish-mcp-server
workflow.The workflow supports 3 params;
update-providers(boolean)
: bumps all providers inpackages/mcp/package.json
providers-to-update(comma-separated values)
: list of providers to bump (to bump one or a specific set instead of all)prerelease(boolean)
: to trigger a prereleaseMCP provider modules
This is an automated process for specific modules (providers-api and dx-core) that triggers releases on each commit push.
For providers that don't want automated publishes and follow a specific release cadence they can trigger the workflow manually.
Either automated or manual, for each provider the workflow will:
detect which providers should be published based on files changed in the pushed commits
publish them to npm (matrix job)
push an additional commit that bumps them in
packages/mcp/package.json
.is needed so that when you checkout
main
you ensurepackages/mcp
is pickup up the code insidepackages/mcp-provider-<module>
instead an old version on npm (same version matches make it resolve to local one).What issues does this PR fix or reference?
@W-19398854@