Skip to content

Conversation

jeremymeng
Copy link
Member

This PR addresses two issues:

  • we should set dev versions for utility packages too but currently don't because of a missing category in the version policy check.

  • we should use dev version of a package for its dependents if its current version satisfies their dependency version range requirements. Currently we use its dev version if its current version equals the minimum version of dependency version range requirements.

While at this, logging is also improved by introduce indentations for nested log lines.

@Copilot Copilot AI review requested due to automatic review settings September 30, 2025 18:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes two issues in the engineering system's versioning script and improves logging with indentation:

  • Adds "utility" to the version policy check so utility packages get dev versions
  • Changes version comparison logic from exact equality to range satisfaction using semver.satisfies()
  • Improves logging by adding indentation through logPrefix parameters for better readability

This PR addresses two issues:

- we should set dev versions for utility packages too but currently don't because of a missing category in the version policy check.

- we should use dev version of a package for its dependents if its current version satisfies their dependency version range requirements.  Currently we use its dev version if its current version equals the minimum version of dependency version range requirements.

While at this, logging is also improved by introducing indentations for nested log lines.
@jeremymeng jeremymeng force-pushed the engsys/set-dev-improve-logging branch from 79a3989 to e38345a Compare September 30, 2025 18:58
if (semver.eq(parsedDepMinVersion, parsedPackageVersion)) {
repoPackages = updatePackageVersion(repoPackages, depName, buildId, catalogs);
console.log(`${logPrefix}resolved version = ${resolvedVersion.resolution.specifier}`);
if (semver.satisfies(packageVersion, resolvedVersion.resolution.specifier)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing to use semver.satisfies

const parsedDepMinVersion = semver.minVersion(depVersionRange);
if (semver.eq(parsedDepMinVersion, parsedPackageVersion)) {
repoPackages = updatePackageVersion(repoPackages, depName, buildId, catalogs);
if (semver.satisfies(packageVersion, depVersionRange)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing to use semver.satisfies

if (resolvedVersion.type === "found") {
const parsedDepMinVersion = semver.minVersion(resolvedVersion.resolution.specifier);
shouldReplace = semver.eq(parsedDepMinVersion, parsedPackageVersion);
shouldReplace = semver.satisfies(packageVersion, resolvedVersion.resolution.specifier);
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing to use semver.satisfies

} else {
const parsedDepMinVersion = semver.minVersion(depVersionRange);
shouldReplace = semver.eq(parsedDepMinVersion, parsedPackageVersion);
shouldReplace = semver.satisfies(packageVersion, depVersionRange);
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing to use semver.satisfies

for (const pkg of Object.keys(repoPackages)) {
if (
["client", "core", "management"].includes(repoPackages[pkg].versionPolicy) &&
["client", "core", "management", "utility"].includes(repoPackages[pkg].versionPolicy) &&
Copy link
Member Author

Choose a reason for hiding this comment

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

adding the missing utility

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.

1 participant