Skip to content

NEW @W-19365711@ Converted package versioning enforcement to git hooks - #339

Merged
jfeingold35 merged 6 commits into
devfrom
d/W-19365711
Aug 28, 2025
Merged

NEW @W-19365711@ Converted package versioning enforcement to git hooks#339
jfeingold35 merged 6 commits into
devfrom
d/W-19365711

Conversation

@jfeingold35

Copy link
Copy Markdown
Contributor

No description provided.

@jfeingold35 jfeingold35 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't need to change anything in the publishing flow, because the commit in the publishing flow is done via graphQL, which I believe should sidestep Husky entirely.

Comment thread .github/workflows/verify-pr.yml
Comment thread package.json
Comment thread .husky/node-scripts/validate-changed-package-versions.js Outdated
Comment thread .github/workflows/verify-pr.yml
Comment on lines +58 to +59
git diff --name-only $HEAD_SHA $BASE_SHA > `pwd`/changed_files.txt
node ./.node-scripts/validate-changed-package-versions.js `pwd`/changed_files.txt

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.

In addition to the husky precommit stuff... do you want to also update these to use the .scatchfile as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could, but it doesn't matter terribly because there's no chance of the file being committed or anything like that.

}
const releasedPackageVersion = getLatestReleasedVersion(changedPackage);
if (semver.lte(semver.parse(packageVersion.slice(0, packageVersion.length - 9)), semver.parse(releasedPackageVersion))) {
incorrectlyVersionedPackages.push(`${changedPackage} (currently versioned as ${packageVersion}) is semantically behind latest published release ${releasedPackageVersion}`);

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.

I think this should say is semantically not ahead of latest... because it could be equal.

@stephen-carter-at-sf stephen-carter-at-sf 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.

Please fix my last 2 comments. Then you are good to merge.

@jfeingold35
jfeingold35 merged commit 2b0dbaf into dev Aug 28, 2025
7 checks passed
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