chore: set up dynamic versioning hatch plugin#471
Conversation
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughVersion resolution now comes from git tags or ChangesVersion source package
SDK release flow
Shared version metadata
Core manifests
Service and plugin manifests
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 18
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
services/core/mcp/pyproject.toml (1)
34-50: 🗄️ Data Integrity & Integration | 🟡 MinorAdd
[tool.uv] cache-keys
services/core/mcp/pyproject.tomlis missing thecache-keysentry used by othernmp-dynamic-versioningmanifests. Add:
cache-keys = [{ file = "pyproject.toml" }, {git = {commit = true, tags = true}}]to avoid stale editable versions after tagging.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@services/core/mcp/pyproject.toml` around lines 34 - 50, Add the missing uv cache configuration to the pyproject.toml manifest used with nmp-dynamic-versioning by introducing a [tool.uv] section with cache-keys set to track pyproject.toml and git commit/tag state; place it near the existing [tool.hatch.version] setup so this manifest matches the other dynamic-versioning projects and editable versions refresh correctly after tagging.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/scripts/stamp_sdk_version.py:
- Around line 33-62: The nightly version fallback in latest_release_core and
resolve_sdk_version is too silent: git tag lookup failures or missing release
tags should not degrade to 0.0.0.dev.... Update latest_release_core to raise or
propagate a clear error when subprocess.run fails or no release cores are found,
and have resolve_sdk_version fail fast instead of fabricating a version when
release tags cannot be resolved. Use the existing latest_release_core,
resolve_sdk_version, and RELEASE_CORE_TAG_PATTERN symbols to locate the logic.
In `@packages/data_designer_nemo/pyproject.toml`:
- Around line 30-34: The pyproject configuration for the data designer package
is missing uv cache invalidation for git-based dynamic versioning, so add the
same tool.uv.cache-keys pattern used in the evaluator SDK config. Update the
[tool.uv.sources] / [tool.hatch.version] area in pyproject.toml to include cache
keys tied to git state so nmp-dynamic-versioning does not serve stale versions
after tags change.
In `@packages/filesets/pyproject.toml`:
- Around line 28-29: The pyproject config for packages/filesets is missing the
uv cache key settings, so editable installs won’t refresh when new tags are
added. Update the existing [tool.hatch.version] area by adding a [tool.uv]
section with cache-keys configured to include pyproject.toml and git commit/tag
metadata, matching the pattern used in
packages/data_designer_nemo/pyproject.toml.
In `@packages/models/pyproject.toml`:
- Around line 21-26: The packages/models pyproject.toml is missing UV cache-key
configuration for dynamic versioning, which can cause editable installs to reuse
a stale version. Update the existing [tool.uv] section in this file to include
cache-keys with the pyproject.toml file and git commit/tag tracking, keeping the
current nmp-dynamic-versioning setup intact.
In `@packages/nmp_build_tools/src/nmp_build_tools/hatch.py`:
- Around line 29-34: The default dynamic versioning config in hatch.py is using
a tag pattern that accepts a leading v, which conflicts with the SDK stamping
policy. Update DEFAULT_DYNAMIC_VERSIONING_CONFIG so the Hatch pattern matches
the bare-release-tag behavior used by stamp_sdk_version.py, and keep the
versioning logic consistent with the same release tag format across both paths.
In `@plugins/example-plugin/pyproject.toml`:
- Around line 8-11: The `nmp-build-tools` source in
`plugins/example-plugin/pyproject.toml` is using a workspace reference that
cannot be resolved because this plugin is not a uv workspace member. Fix it by
either adding `plugins/example-plugin` to the `[tool.uv.workspace].members` list
so `workspace = true` has a valid target, or replace the `nmp-build-tools` entry
in `[tool.uv.sources]` with a local path reference that points to the actual
package; use the existing `tool.uv.sources` and `tool.uv.workspace` sections to
make the dependency resolvable.
In `@plugins/nemo-auditor/pyproject.toml`:
- Around line 38-50: The uv configuration in pyproject.toml is missing git-aware
cache keys, so cached wheels can reuse stale git-derived versions. Update the
[tool.uv] settings for this package to include cache-keys with git commit and
tag tracking, matching the pattern used in services/core/secrets/pyproject.toml,
so the dynamic version source used by hatch/version and nmp-dynamic-versioning
is invalidated when git metadata changes.
In `@plugins/nemo-automodel/pyproject.toml`:
- Around line 24-40: Add the missing git-based cache key invalidation to this
manifest so new tags refresh builds: in the pyproject.toml section that already
defines tool.uv.sources, introduce tool.uv.cache-keys with the git settings used
by the other migrated manifests, and ensure it includes commit and tags for the
workspace package entries so the build cache is invalidated when tags change.
In `@plugins/nemo-customizer/pyproject.toml`:
- Around line 29-42: The wheel build configuration is missing git-based cache
keys, which can allow uv to reuse a cached wheel after version changes. Update
the pyproject configuration by adding tool.uv.cache-keys with git commit and
tags enabled, matching the pattern used in services/guardrails/pyproject.toml,
so the dynamic versioning setup tied to nmp-dynamic-versioning and the wheel
target for src/nemo_customizer stays in sync with git state.
In `@plugins/nemo-data-designer/pyproject.toml`:
- Around line 78-85: The pyproject configuration for the dynamic versioning
setup is missing git-based cache invalidation, which can let a stale build hide
the current git-derived version. Update the tool.uv configuration in the same
section as tool.hatch.version and tool.uv.sources by adding tool.uv.cache-keys
with git commit and tag tracking enabled, so the version computed by
nmp-dynamic-versioning always reflects the latest repository state.
In `@plugins/nemo-evaluator/openapi/openapi.yaml`:
- Around line 696-700: The OpenAPI schema for the blob field is using the wrong
encoding metadata, which conflicts with the runtime bytes serialization in the
related models. Update the blob definition in the openapi schema to reflect
base64 encoding by replacing the base64url format usage with contentEncoding set
to base64, and keep the description aligned with the wire contract.
In `@services/core/jobs/pyproject.toml`:
- Around line 37-52: Add the missing uv cache key configuration in the
pyproject.toml section so editable installs pick up new git tags for
nmp-dynamic-versioning. Update the existing [tool.uv] area near the current
[tool.uv.sources] and [tool.hatch.version] settings by defining cache-keys with
both the pyproject.toml file and git commit/tag tracking, using the same
configuration shape described in the comment.
In `@services/core/models/pyproject.toml`:
- Around line 39-40: The versioning config in the models workspace is missing
the uv cache key entries, so add the same [tool.uv] cache-keys settings here as
in the root pyproject.toml. Update this pyproject.toml alongside the existing
[tool.hatch.version] section so uv tracks pyproject.toml changes and git
commit/tag changes for this workspace member.
In `@services/core/secrets/pyproject.toml`:
- Around line 33-34: The pyproject manifest for the secrets service is missing
uv cache keys, so cached wheels can be reused across different git tags when
using nmp-dynamic-versioning. Update the [tool.uv] section in pyproject.toml to
include the same cache-keys configuration used by the guardrails manifest,
referencing pyproject.toml and git commit/tag changes so uv invalidates the
build cache correctly.
In `@services/hello-world/pyproject.toml`:
- Around line 36-43: The hello-world pyproject is missing uv cache invalidation
for git-based dynamic versioning, so the cached wheel can stay stale after new
tags. Update the [tool.uv.cache-keys] configuration in this file to include the
git commit and tag inputs, matching the pattern used by the core secrets
pyproject, and keep the change near the existing
hatchling/nmp-dynamic-versioning settings so the cache is tied to
version-relevant git state.
In `@services/intake/pyproject.toml`:
- Around line 50-64: Add the missing tool.uv.cache-keys entry to the other
manifests that use nmp-dynamic-versioning, mirroring the existing pyproject.toml
setup so uv considers both the manifest file and git commit/tags when resolving
versions. Update the relevant pyproject.toml sections near tool.uv and
nmp-dynamic-versioning, ensuring the cache-keys list includes { git = { commit =
true, tags = true } } wherever it is absent.
In `@tools/mcp-dev-tools/pyproject.toml`:
- Around line 46-51: Add a tool.uv.cache-keys section in pyproject.toml for the
mcp-dev-tools project so uv invalidates cached builds when git metadata changes.
Update the configuration near [tool.hatch.version] and [tool.uv.sources] to
include git commit/tag-based cache keys alongside nmp-dynamic-versioning,
ensuring versioned releases do not reuse stale build artifacts when only tags
change.
In
`@tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/core/version.py`:
- Line 13: The version helper is being evaluated too early because
`update_sdk_version(..., version: str = get_sdk_version())` captures
`get_sdk_version()` at import time, so later changes to
`UV_DYNAMIC_VERSIONING_BYPASS` are ignored. Update `update_sdk_version` (and any
similar default-argument usage) to read the version inside the function body at
call time by calling `get_sdk_version()` when no explicit version is passed, so
`get_sdk_version` always reflects the current environment.
---
Outside diff comments:
In `@services/core/mcp/pyproject.toml`:
- Around line 34-50: Add the missing uv cache configuration to the
pyproject.toml manifest used with nmp-dynamic-versioning by introducing a
[tool.uv] section with cache-keys set to track pyproject.toml and git commit/tag
state; place it near the existing [tool.hatch.version] setup so this manifest
matches the other dynamic-versioning projects and editable versions refresh
correctly after tagging.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1350c716-21a7-4083-a916-80350ce08733
⛔ Files ignored due to path filters (4)
sdk/python/nemo-platform/pyproject.tomlis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/_version.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/__init__.pyis excluded by!sdk/**uv.lockis excluded by!**/*.lock
📒 Files selected for processing (68)
.github/actions/build-nemo-platform-wheel/action.yaml.github/scripts/stamp_sdk_version.py.github/workflows/release-bundle.yamlopenapi/ga/individual/platform.openapi.yamlopenapi/ga/openapi.yamlopenapi/openapi.yamlpackages/data_designer_nemo/pyproject.tomlpackages/filesets/pyproject.tomlpackages/models/pyproject.tomlpackages/nemo_evaluator_sdk/pyproject.tomlpackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/__init__.pypackages/nemo_nb/nemo_nb/__init__.pypackages/nemo_nb/pyproject.tomlpackages/nemo_platform/pyproject.tomlpackages/nemo_platform_ext/pyproject.tomlpackages/nemo_platform_plugin/pyproject.tomlpackages/nmp_build_tools/pyproject.tomlpackages/nmp_build_tools/src/nmp_build_tools/hatch.pypackages/nmp_build_tools/tests/test_hatch.pypackages/nmp_common/pyproject.tomlpackages/nmp_common/src/nmp/common/version.pypackages/nmp_customization_common/pyproject.tomlpackages/nmp_customization_common/src/nmp/customization_common/version.pypackages/nmp_platform/pyproject.tomlpackages/nmp_platform_runner/pyproject.tomlpackages/nmp_platform_runner/src/nmp/platform_runner/run.pypackages/nmp_testing/pyproject.tomlplugins/example-plugin/pyproject.tomlplugins/nemo-agents/examples/calculator-agent/pyproject.tomlplugins/nemo-agents/openapi/openapi.yamlplugins/nemo-agents/pyproject.tomlplugins/nemo-anonymizer/pyproject.tomlplugins/nemo-auditor/openapi/openapi.yamlplugins/nemo-auditor/pyproject.tomlplugins/nemo-automodel/pyproject.tomlplugins/nemo-customizer/pyproject.tomlplugins/nemo-data-designer/openapi/openapi.yamlplugins/nemo-data-designer/pyproject.tomlplugins/nemo-deployments/openapi/openapi.yamlplugins/nemo-deployments/pyproject.tomlplugins/nemo-evaluator/openapi/openapi.yamlplugins/nemo-evaluator/pyproject.tomlplugins/nemo-guardrails/pyproject.tomlplugins/nemo-safe-synthesizer/openapi/openapi.yamlplugins/nemo-safe-synthesizer/pyproject.tomlplugins/nemo-unsloth/pyproject.tomlpyproject.tomlscript/openapi_helper/openapi_tools.pyservices/automodel/pyproject.tomlservices/core/auth/pyproject.tomlservices/core/entities/pyproject.tomlservices/core/entities/src/nmp/core/entities/api/server.pyservices/core/files/pyproject.tomlservices/core/inference-gateway/pyproject.tomlservices/core/jobs/pyproject.tomlservices/core/mcp/pyproject.tomlservices/core/models/pyproject.tomlservices/core/secrets/pyproject.tomlservices/guardrails/pyproject.tomlservices/hello-world/pyproject.tomlservices/intake/pyproject.tomlservices/studio/pyproject.tomlservices/unsloth/pyproject.tomltests/unit/release/test_stamp_sdk_version.pytools/mcp-dev-tools/pyproject.tomltools/nemo-platform-sdk-tools/pyproject.tomltools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/core/version.pytools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/post_generation_update.py
| def latest_release_core(source_root: Path) -> str | None: | ||
| result = subprocess.run( | ||
| ["git", "-C", str(source_root), "tag", "--merged", "HEAD", "--list"], | ||
| check=False, | ||
| stdout=subprocess.PIPE, | ||
| stderr=subprocess.PIPE, | ||
| text=True, | ||
| ) | ||
| if result.returncode != 0: | ||
| return None | ||
|
|
||
| index = matches[0] | ||
| newline = "\n" if lines[index].endswith("\n") else "" | ||
| lines[index] = f'{name} = "{value}"{newline}' | ||
| path.write_text("".join(lines), encoding="utf-8") | ||
| release_cores = [] | ||
| for tag in result.stdout.splitlines(): | ||
| match = RELEASE_CORE_TAG_PATTERN.fullmatch(tag) | ||
| if match: | ||
| release_cores.append(match.group(1)) | ||
| if not release_cores: | ||
| return None | ||
| return max(release_cores, key=_semver_key) | ||
|
|
||
|
|
||
| def resolve_sdk_version( | ||
| cadence: Cadence, | ||
| release_label: str, | ||
| nightly_timestamp: str, | ||
| shared_sdk_version_path: Path, | ||
| source_root: Path, | ||
| ) -> str: | ||
| if cadence == "nightly": | ||
| base_version = read_assignment(shared_sdk_version_path, "platform_sdk_version") | ||
| if not re.fullmatch(SEMVER_CORE_PATTERN, base_version): | ||
| raise StampError(f"nightly base SDK version must be SemVer core MAJOR.MINOR.PATCH: {base_version}") | ||
| base_version = latest_release_core(source_root) or "0.0.0" | ||
| if not re.fullmatch(r"\d{14}", nightly_timestamp): |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Fail when release tags cannot be resolved.
Lines 41-62 silently turn git failures or missing fetched tags into 0.0.0.dev..., which can publish a wrongly ordered nightly. Make tag resolution failure explicit.
Proposed fix
-def latest_release_core(source_root: Path) -> str | None:
+def latest_release_core(source_root: Path) -> str:
result = subprocess.run(
["git", "-C", str(source_root), "tag", "--merged", "HEAD", "--list"],
check=False,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
if result.returncode != 0:
- return None
+ detail = result.stderr.strip() or f"git exited with {result.returncode}"
+ raise StampError(f"failed to inspect merged release tags: {detail}")
release_cores = []
for tag in result.stdout.splitlines():
match = RELEASE_CORE_TAG_PATTERN.fullmatch(tag)
if match:
release_cores.append(match.group(1))
if not release_cores:
- return None
+ raise StampError("no merged SemVer release tags found; fetch tags before resolving nightly version")
return max(release_cores, key=_semver_key)
@@
if cadence == "nightly":
- base_version = latest_release_core(source_root) or "0.0.0"
+ base_version = latest_release_core(source_root)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| def latest_release_core(source_root: Path) -> str | None: | |
| result = subprocess.run( | |
| ["git", "-C", str(source_root), "tag", "--merged", "HEAD", "--list"], | |
| check=False, | |
| stdout=subprocess.PIPE, | |
| stderr=subprocess.PIPE, | |
| text=True, | |
| ) | |
| if result.returncode != 0: | |
| return None | |
| index = matches[0] | |
| newline = "\n" if lines[index].endswith("\n") else "" | |
| lines[index] = f'{name} = "{value}"{newline}' | |
| path.write_text("".join(lines), encoding="utf-8") | |
| release_cores = [] | |
| for tag in result.stdout.splitlines(): | |
| match = RELEASE_CORE_TAG_PATTERN.fullmatch(tag) | |
| if match: | |
| release_cores.append(match.group(1)) | |
| if not release_cores: | |
| return None | |
| return max(release_cores, key=_semver_key) | |
| def resolve_sdk_version( | |
| cadence: Cadence, | |
| release_label: str, | |
| nightly_timestamp: str, | |
| shared_sdk_version_path: Path, | |
| source_root: Path, | |
| ) -> str: | |
| if cadence == "nightly": | |
| base_version = read_assignment(shared_sdk_version_path, "platform_sdk_version") | |
| if not re.fullmatch(SEMVER_CORE_PATTERN, base_version): | |
| raise StampError(f"nightly base SDK version must be SemVer core MAJOR.MINOR.PATCH: {base_version}") | |
| base_version = latest_release_core(source_root) or "0.0.0" | |
| if not re.fullmatch(r"\d{14}", nightly_timestamp): | |
| def latest_release_core(source_root: Path) -> str: | |
| result = subprocess.run( | |
| ["git", "-C", str(source_root), "tag", "--merged", "HEAD", "--list"], | |
| check=False, | |
| stdout=subprocess.PIPE, | |
| stderr=subprocess.PIPE, | |
| text=True, | |
| ) | |
| if result.returncode != 0: | |
| detail = result.stderr.strip() or f"git exited with {result.returncode}" | |
| raise StampError(f"failed to inspect merged release tags: {detail}") | |
| release_cores = [] | |
| for tag in result.stdout.splitlines(): | |
| match = RELEASE_CORE_TAG_PATTERN.fullmatch(tag) | |
| if match: | |
| release_cores.append(match.group(1)) | |
| if not release_cores: | |
| raise StampError("no merged SemVer release tags found; fetch tags before resolving nightly version") | |
| return max(release_cores, key=_semver_key) | |
| def resolve_sdk_version( | |
| cadence: Cadence, | |
| release_label: str, | |
| nightly_timestamp: str, | |
| source_root: Path, | |
| ) -> str: | |
| if cadence == "nightly": | |
| base_version = latest_release_core(source_root) | |
| if not re.fullmatch(r"\d{14}", nightly_timestamp): |
🧰 Tools
🪛 ast-grep (0.44.0)
[error] 33-39: Command coming from incoming request
Context: subprocess.run(
["git", "-C", str(source_root), "tag", "--merged", "HEAD", "--list"],
check=False,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(subprocess-from-request)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/scripts/stamp_sdk_version.py around lines 33 - 62, The nightly
version fallback in latest_release_core and resolve_sdk_version is too silent:
git tag lookup failures or missing release tags should not degrade to
0.0.0.dev.... Update latest_release_core to raise or propagate a clear error
when subprocess.run fails or no release cores are found, and have
resolve_sdk_version fail fast instead of fabricating a version when release tags
cannot be resolved. Use the existing latest_release_core, resolve_sdk_version,
and RELEASE_CORE_TAG_PATTERN symbols to locate the logic.
|
|
||
| def get_sdk_version(): | ||
| return platform_sdk_version | ||
| return os.environ.get("UV_DYNAMIC_VERSIONING_BYPASS", "0.0.0") |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== file ==\n'
cat -n tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/core/version.py
printf '\n== usages ==\n'
rg -n "update_sdk_version\(|get_sdk_version\(" tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools -SRepository: NVIDIA-NeMo/nemo-platform
Length of output: 2703
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== file ==\n'
cat -n tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/core/version.py
printf '\n== usages ==\n'
rg -n "update_sdk_version\(|get_sdk_version\(" tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools -SRepository: NVIDIA-NeMo/nemo-platform
Length of output: 2703
Read UV_DYNAMIC_VERSIONING_BYPASS at call time.
update_sdk_version(..., version: str = get_sdk_version()) evaluates the env once at import, so later env changes are ignored and can still stamp 0.0.0.
Proposed fix
-def update_sdk_version(sdk_info: SdkInfo, version: str = get_sdk_version()) -> None:
+def update_sdk_version(sdk_info: SdkInfo, version: str | None = None) -> None:
+ if version is None:
+ version = get_sdk_version()
update_package_version(sdk_info.package_name, str(sdk_info.sdk_dir), version)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/core/version.py`
at line 13, The version helper is being evaluated too early because
`update_sdk_version(..., version: str = get_sdk_version())` captures
`get_sdk_version()` at import time, so later changes to
`UV_DYNAMIC_VERSIONING_BYPASS` are ignored. Update `update_sdk_version` (and any
similar default-argument usage) to read the version inside the function body at
call time by calling `get_sdk_version()` when no explicit version is passed, so
`get_sdk_version` always reflects the current environment.
| repository: ${{ needs.plan-release.outputs.source_repo }} | ||
| ref: ${{ needs.plan-release.outputs.source_sha }} | ||
| path: source | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
this just speed things up?
There was a problem hiding this comment.
opposite, it disables a shallow clone lol
34433df to
a1173e3
Compare
|
|
||
| [build-system] | ||
| requires = ["hatchling"] | ||
| requires = ["hatchling", "nmp-build-tools"] |
There was a problem hiding this comment.
(seeing this repeat down below) did we have to do this for each of the subpackages? Since they aren't ever actually published, wondering if its necessary, and if things exploded without it
There was a problem hiding this comment.
yeahhh I kept asking if this was really necessary, I guess they'll default to 0.0.0 if we don't do this. there was a version where each one had the uv-version plugin imported and their own versions set, I liked that this was a bit more DRY, but maybe totally unnecessary
There was a problem hiding this comment.
I just set them all to 0.0.0 except for a handful
a1173e3 to
4a8fecb
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/scripts/stamp_sdk_version.py:
- Around line 60-64: The nightly version in stamp_sdk_version.py currently uses
base_version.devYYYYMMDDHHMMSS, which can sort before the latest release and rc
builds. Update the nightly branch in the version-building logic (the cadence ==
"nightly" path in the stamping function) so it produces a version that orders
after the current release line, either by bumping the target core version before
appending the nightly suffix or by switching to a version scheme that
consistently sorts above published and rc artifacts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: e2026819-884f-4a3e-9834-6219d8045e0f
⛔ Files ignored due to path filters (5)
sdk/python/nemo-platform/.nmpcontext/openapi.yamlis excluded by!sdk/**sdk/python/nemo-platform/pyproject.tomlis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/_version.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/__init__.pyis excluded by!sdk/**uv.lockis excluded by!**/*.lock
📒 Files selected for processing (68)
.github/actions/build-nemo-platform-wheel/action.yaml.github/scripts/stamp_sdk_version.py.github/workflows/release-bundle.yamlopenapi/ga/individual/platform.openapi.yamlopenapi/ga/openapi.yamlopenapi/openapi.yamlpackages/data_designer_nemo/pyproject.tomlpackages/filesets/pyproject.tomlpackages/models/pyproject.tomlpackages/nemo_evaluator_sdk/pyproject.tomlpackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/__init__.pypackages/nemo_nb/nemo_nb/__init__.pypackages/nemo_nb/pyproject.tomlpackages/nemo_platform/pyproject.tomlpackages/nemo_platform_ext/pyproject.tomlpackages/nemo_platform_plugin/pyproject.tomlpackages/nmp_build_tools/pyproject.tomlpackages/nmp_build_tools/src/nmp_build_tools/hatch.pypackages/nmp_build_tools/tests/test_hatch.pypackages/nmp_common/pyproject.tomlpackages/nmp_common/src/nmp/common/version.pypackages/nmp_customization_common/pyproject.tomlpackages/nmp_customization_common/src/nmp/customization_common/version.pypackages/nmp_platform/pyproject.tomlpackages/nmp_platform_runner/pyproject.tomlpackages/nmp_platform_runner/src/nmp/platform_runner/run.pypackages/nmp_testing/pyproject.tomlplugins/example-plugin/pyproject.tomlplugins/nemo-agents/examples/calculator-agent/pyproject.tomlplugins/nemo-agents/openapi/openapi.yamlplugins/nemo-agents/pyproject.tomlplugins/nemo-anonymizer/pyproject.tomlplugins/nemo-auditor/openapi/openapi.yamlplugins/nemo-auditor/pyproject.tomlplugins/nemo-automodel/pyproject.tomlplugins/nemo-customizer/pyproject.tomlplugins/nemo-data-designer/openapi/openapi.yamlplugins/nemo-data-designer/pyproject.tomlplugins/nemo-deployments/openapi/openapi.yamlplugins/nemo-deployments/pyproject.tomlplugins/nemo-evaluator/openapi/openapi.yamlplugins/nemo-evaluator/pyproject.tomlplugins/nemo-guardrails/pyproject.tomlplugins/nemo-safe-synthesizer/openapi/openapi.yamlplugins/nemo-safe-synthesizer/pyproject.tomlplugins/nemo-unsloth/pyproject.tomlpyproject.tomlscript/openapi_helper/openapi_tools.pyservices/automodel/pyproject.tomlservices/core/auth/pyproject.tomlservices/core/entities/pyproject.tomlservices/core/entities/src/nmp/core/entities/api/server.pyservices/core/files/pyproject.tomlservices/core/inference-gateway/pyproject.tomlservices/core/jobs/pyproject.tomlservices/core/mcp/pyproject.tomlservices/core/models/pyproject.tomlservices/core/secrets/pyproject.tomlservices/guardrails/pyproject.tomlservices/hello-world/pyproject.tomlservices/intake/pyproject.tomlservices/studio/pyproject.tomlservices/unsloth/pyproject.tomltests/unit/release/test_stamp_sdk_version.pytools/mcp-dev-tools/pyproject.tomltools/nemo-platform-sdk-tools/pyproject.tomltools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/core/version.pytools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/post_generation_update.py
✅ Files skipped from review due to trivial changes (7)
- plugins/nemo-auditor/openapi/openapi.yaml
- plugins/nemo-data-designer/openapi/openapi.yaml
- plugins/nemo-agents/openapi/openapi.yaml
- openapi/openapi.yaml
- openapi/ga/openapi.yaml
- plugins/nemo-safe-synthesizer/openapi/openapi.yaml
- plugins/nemo-deployments/openapi/openapi.yaml
🚧 Files skipped from review as they are similar to previous changes (59)
- packages/nmp_customization_common/src/nmp/customization_common/version.py
- services/core/entities/src/nmp/core/entities/api/server.py
- packages/nmp_platform_runner/src/nmp/platform_runner/run.py
- openapi/ga/individual/platform.openapi.yaml
- packages/nemo_nb/nemo_nb/init.py
- plugins/example-plugin/pyproject.toml
- tools/mcp-dev-tools/pyproject.toml
- services/automodel/pyproject.toml
- plugins/nemo-evaluator/pyproject.toml
- .github/workflows/release-bundle.yaml
- script/openapi_helper/openapi_tools.py
- packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/init.py
- packages/nemo_platform_plugin/pyproject.toml
- plugins/nemo-customizer/pyproject.toml
- packages/nemo_platform/pyproject.toml
- services/core/jobs/pyproject.toml
- packages/nmp_build_tools/tests/test_hatch.py
- plugins/nemo-auditor/pyproject.toml
- packages/models/pyproject.toml
- plugins/nemo-agents/pyproject.toml
- packages/nemo_evaluator_sdk/pyproject.toml
- .github/actions/build-nemo-platform-wheel/action.yaml
- plugins/nemo-data-designer/pyproject.toml
- services/core/mcp/pyproject.toml
- packages/nmp_platform/pyproject.toml
- services/core/entities/pyproject.toml
- services/core/models/pyproject.toml
- packages/nmp_common/src/nmp/common/version.py
- services/guardrails/pyproject.toml
- packages/nmp_common/pyproject.toml
- services/core/files/pyproject.toml
- plugins/nemo-deployments/pyproject.toml
- tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/core/version.py
- packages/nmp_platform_runner/pyproject.toml
- packages/data_designer_nemo/pyproject.toml
- packages/nmp_build_tools/pyproject.toml
- services/unsloth/pyproject.toml
- plugins/nemo-guardrails/pyproject.toml
- plugins/nemo-anonymizer/pyproject.toml
- services/core/inference-gateway/pyproject.toml
- services/core/secrets/pyproject.toml
- services/studio/pyproject.toml
- packages/nemo_platform_ext/pyproject.toml
- plugins/nemo-agents/examples/calculator-agent/pyproject.toml
- plugins/nemo-automodel/pyproject.toml
- services/intake/pyproject.toml
- services/core/auth/pyproject.toml
- plugins/nemo-safe-synthesizer/pyproject.toml
- plugins/nemo-evaluator/openapi/openapi.yaml
- packages/filesets/pyproject.toml
- packages/nmp_testing/pyproject.toml
- packages/nmp_build_tools/src/nmp_build_tools/hatch.py
- plugins/nemo-unsloth/pyproject.toml
- packages/nmp_customization_common/pyproject.toml
- tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/post_generation_update.py
- services/hello-world/pyproject.toml
- tools/nemo-platform-sdk-tools/pyproject.toml
- pyproject.toml
- packages/nemo_nb/pyproject.toml
| if cadence == "nightly": | ||
| base_version = read_assignment(shared_sdk_version_path, "platform_sdk_version") | ||
| if not re.fullmatch(SEMVER_CORE_PATTERN, base_version): | ||
| raise StampError(f"nightly base SDK version must be SemVer core MAJOR.MINOR.PATCH: {base_version}") | ||
| base_version = latest_release_core(source_root) or "0.0.0" | ||
| if not re.fullmatch(r"\d{14}", nightly_timestamp): | ||
| raise StampError("nightly timestamp must be YYYYMMDDHHMMSS") | ||
| return f"{base_version}.dev{nightly_timestamp}" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify PEP 440 ordering. Expect both comparisons to print False with the current scheme.
python - <<'PY'
from packaging.version import Version
print(Version("1.2.0.dev20260512010101") > Version("1.2.0"))
print(Version("2.1.0.dev20260512010101") > Version("2.1.0rc0"))
PYRepository: NVIDIA-NeMo/nemo-platform
Length of output: 175
Make nightly versions sort after the latest release
{base_version}.devYYYYMMDDHHMMSS sorts before both base_version and rc releases, so nightlies can look older than published artifacts. Bump the target core or use a scheme that orders after the latest release.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/scripts/stamp_sdk_version.py around lines 60 - 64, The nightly
version in stamp_sdk_version.py currently uses base_version.devYYYYMMDDHHMMSS,
which can sort before the latest release and rc builds. Update the nightly
branch in the version-building logic (the cadence == "nightly" path in the
stamping function) so it produces a version that orders after the current
release line, either by bumping the target core version before appending the
nightly suffix or by switching to a version scheme that consistently sorts above
published and rc artifacts.
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
4a8fecb to
6ac2720
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
RELEASING.md (2)
23-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSplit the versioning model into a separate explanation page.
## Versioning modelturns this how-to into a mixed how-to/explanation page. Keep this page procedural and link out to a separate explanation doc for the build-time versioning rationale. As per coding guidelines, "Each documentation page should fit ONE Diataxis quadrant; do not mix tutorials with reference tables or how-tos with architecture explanations; use cross-links instead".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@RELEASING.md` around lines 23 - 35, The “Versioning model” section makes this page mix procedural release steps with architecture rationale; move the explanatory content into a separate documentation page and keep RELEASING.md focused on how-to instructions. Update the release docs around the versioning discussion in RELEASING.md to link out to the new explanation page, and preserve only the operational guidance tied to the release workflow, dynamic versioning, and package naming such as nmp_build_tools and the release catalog.Source: Coding guidelines
5-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove prerequisites to the top.
This page still scatters prerequisites between the intro and Step 1 (
nmp_devopsapproval on Line 5,STAINLESS_API_KEYon Line 48). Add a dedicated prerequisites section before## Overview. As per coding guidelines, "Always list prerequisites at the top of documentation pages before other content".Also applies to: 38-49
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@RELEASING.md` around lines 5 - 15, The release guide currently splits prerequisites between the intro and later steps, so move them into a dedicated prerequisites section before the Overview. Add a top-level “Prerequisites” section near the start of RELEASING.md and place the `nmp_devops` approval requirement and the `STAINLESS_API_KEY` requirement there, then keep the remaining release flow in the later sections.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/nmp_platform_runner/pyproject.toml`:
- Around line 13-19: Restore dynamic versioning in nmp-platform-runner by
replacing the hardcoded version setup in pyproject.toml with the Hatch dynamic
version source used elsewhere, and ensure the package metadata is driven by
nmp-dynamic-versioning so nmp/platform_runner/version.py resolves the real
version instead of 0.0.0. Update the project configuration around the version
declaration and add the missing [tool.hatch.version] setting, keeping the
existing workspace source entries intact.
---
Nitpick comments:
In `@RELEASING.md`:
- Around line 23-35: The “Versioning model” section makes this page mix
procedural release steps with architecture rationale; move the explanatory
content into a separate documentation page and keep RELEASING.md focused on
how-to instructions. Update the release docs around the versioning discussion in
RELEASING.md to link out to the new explanation page, and preserve only the
operational guidance tied to the release workflow, dynamic versioning, and
package naming such as nmp_build_tools and the release catalog.
- Around line 5-15: The release guide currently splits prerequisites between the
intro and later steps, so move them into a dedicated prerequisites section
before the Overview. Add a top-level “Prerequisites” section near the start of
RELEASING.md and place the `nmp_devops` approval requirement and the
`STAINLESS_API_KEY` requirement there, then keep the remaining release flow in
the later sections.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: b95ea0b0-0528-4f61-ac4f-2f9fac2d8da6
⛔ Files ignored due to path filters (5)
sdk/python/nemo-platform/.nmpcontext/openapi.yamlis excluded by!sdk/**sdk/python/nemo-platform/pyproject.tomlis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/_version.pyis excluded by!sdk/**sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/__init__.pyis excluded by!sdk/**uv.lockis excluded by!**/*.lock
📒 Files selected for processing (69)
.github/actions/build-nemo-platform-wheel/action.yaml.github/scripts/stamp_sdk_version.py.github/workflows/release-bundle.yamlRELEASING.mdopenapi/ga/individual/platform.openapi.yamlopenapi/ga/openapi.yamlopenapi/openapi.yamlpackages/data_designer_nemo/pyproject.tomlpackages/filesets/pyproject.tomlpackages/models/pyproject.tomlpackages/nemo_evaluator_sdk/pyproject.tomlpackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/__init__.pypackages/nemo_nb/nemo_nb/__init__.pypackages/nemo_nb/pyproject.tomlpackages/nemo_platform/pyproject.tomlpackages/nemo_platform_ext/pyproject.tomlpackages/nemo_platform_plugin/pyproject.tomlpackages/nmp_build_tools/pyproject.tomlpackages/nmp_build_tools/src/nmp_build_tools/hatch.pypackages/nmp_build_tools/tests/test_hatch.pypackages/nmp_common/pyproject.tomlpackages/nmp_common/src/nmp/common/version.pypackages/nmp_customization_common/pyproject.tomlpackages/nmp_customization_common/src/nmp/customization_common/version.pypackages/nmp_platform/pyproject.tomlpackages/nmp_platform_runner/pyproject.tomlpackages/nmp_platform_runner/src/nmp/platform_runner/run.pypackages/nmp_testing/pyproject.tomlplugins/example-plugin/pyproject.tomlplugins/nemo-agents/examples/calculator-agent/pyproject.tomlplugins/nemo-agents/openapi/openapi.yamlplugins/nemo-agents/pyproject.tomlplugins/nemo-anonymizer/pyproject.tomlplugins/nemo-auditor/openapi/openapi.yamlplugins/nemo-auditor/pyproject.tomlplugins/nemo-automodel/pyproject.tomlplugins/nemo-customizer/pyproject.tomlplugins/nemo-data-designer/openapi/openapi.yamlplugins/nemo-data-designer/pyproject.tomlplugins/nemo-deployments/openapi/openapi.yamlplugins/nemo-deployments/pyproject.tomlplugins/nemo-evaluator/openapi/openapi.yamlplugins/nemo-evaluator/pyproject.tomlplugins/nemo-guardrails/pyproject.tomlplugins/nemo-safe-synthesizer/openapi/openapi.yamlplugins/nemo-safe-synthesizer/pyproject.tomlplugins/nemo-unsloth/pyproject.tomlpyproject.tomlscript/openapi_helper/openapi_tools.pyservices/automodel/pyproject.tomlservices/core/auth/pyproject.tomlservices/core/entities/pyproject.tomlservices/core/entities/src/nmp/core/entities/api/server.pyservices/core/files/pyproject.tomlservices/core/inference-gateway/pyproject.tomlservices/core/jobs/pyproject.tomlservices/core/mcp/pyproject.tomlservices/core/models/pyproject.tomlservices/core/secrets/pyproject.tomlservices/guardrails/pyproject.tomlservices/hello-world/pyproject.tomlservices/intake/pyproject.tomlservices/studio/pyproject.tomlservices/unsloth/pyproject.tomltests/unit/release/test_stamp_sdk_version.pytools/mcp-dev-tools/pyproject.tomltools/nemo-platform-sdk-tools/pyproject.tomltools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/core/version.pytools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/post_generation_update.py
✅ Files skipped from review due to trivial changes (16)
- plugins/nemo-agents/openapi/openapi.yaml
- plugins/nemo-deployments/openapi/openapi.yaml
- openapi/ga/individual/platform.openapi.yaml
- plugins/nemo-data-designer/openapi/openapi.yaml
- plugins/nemo-safe-synthesizer/openapi/openapi.yaml
- services/core/entities/src/nmp/core/entities/api/server.py
- plugins/nemo-evaluator/openapi/openapi.yaml
- plugins/nemo-auditor/openapi/openapi.yaml
- packages/nmp_platform_runner/src/nmp/platform_runner/run.py
- openapi/openapi.yaml
- packages/nmp_testing/pyproject.toml
- services/core/entities/pyproject.toml
- tools/mcp-dev-tools/pyproject.toml
- .github/workflows/release-bundle.yaml
- openapi/ga/openapi.yaml
- packages/models/pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (12)
- packages/nemo_nb/nemo_nb/init.py
- packages/nmp_customization_common/src/nmp/customization_common/version.py
- script/openapi_helper/openapi_tools.py
- packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/init.py
- packages/nmp_common/src/nmp/common/version.py
- tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/core/version.py
- packages/nmp_build_tools/tests/test_hatch.py
- packages/nemo_platform_plugin/pyproject.toml
- .github/actions/build-nemo-platform-wheel/action.yaml
- packages/nemo_platform/pyproject.toml
- packages/nmp_build_tools/src/nmp_build_tools/hatch.py
- tools/nemo-platform-sdk-tools/src/nemo_platform_sdk_tools/sdk/post_generation_update.py
| version = "0.0.0" | ||
|
|
||
| [tool.uv.sources] | ||
| nemo-platform-plugin = { workspace = true } | ||
| nmp-common = { workspace = true } | ||
| nmp-testing = { workspace = true } | ||
|
|
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python - <<'PY'
from pathlib import Path
import tomllib
path = Path("packages/nmp_platform_runner/pyproject.toml")
data = tomllib.loads(path.read_text())
print("project.version:", data.get("project", {}).get("version"))
print("build-system.requires:", data.get("build-system", {}).get("requires"))
print("tool.hatch.version:", data.get("tool", {}).get("hatch", {}).get("version"))
PYRepository: NVIDIA-NeMo/nemo-platform
Length of output: 248
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- packages/nmp_platform_runner/pyproject.toml ---'
cat -n packages/nmp_platform_runner/pyproject.toml | sed -n '1,120p'
echo
echo '--- packages/nmp_platform_runner/src/nmp/platform_runner/version.py ---'
cat -n packages/nmp_platform_runner/src/nmp/platform_runner/version.py | sed -n '1,120p'
echo
echo '--- search for nmp-dynamic-versioning in repository ---'
rg -n "nmp-dynamic-versioning|tool\.hatch\.version|nmp-build-tools" packages -g 'pyproject.toml' -g '*.py'Repository: NVIDIA-NeMo/nemo-platform
Length of output: 3668
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- packages/nmp_platform_runner/pyproject.toml ---'
cat -n packages/nmp_platform_runner/pyproject.toml | sed -n '1,120p'
echo
echo '--- packages/nmp_platform_runner/src/nmp/platform_runner/version.py ---'
cat -n packages/nmp_platform_runner/src/nmp/platform_runner/version.py | sed -n '1,120p'
echo
echo '--- search for nmp-dynamic-versioning in repository ---'
rg -n "nmp-dynamic-versioning|tool\.hatch\.version|nmp-build-tools" packages -g 'pyproject.toml' -g '*.py'Repository: NVIDIA-NeMo/nemo-platform
Length of output: 3668
Restore dynamic versioning for nmp-platform-runner. packages/nmp_platform_runner/pyproject.toml only sets version = "0.0.0" and omits [tool.hatch.version] source = "nmp-dynamic-versioning", so the installed distribution metadata stays 0.0.0 and packages/nmp_platform_runner/src/nmp/platform_runner/version.py will return that.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/nmp_platform_runner/pyproject.toml` around lines 13 - 19, Restore
dynamic versioning in nmp-platform-runner by replacing the hardcoded version
setup in pyproject.toml with the Hatch dynamic version source used elsewhere,
and ensure the package metadata is driven by nmp-dynamic-versioning so
nmp/platform_runner/version.py resolves the real version instead of 0.0.0.
Update the project configuration around the version declaration and add the
missing [tool.hatch.version] setting, keeping the existing workspace source
entries intact.
Summary by CodeRabbit
info.versionis normalized to0.0.0, with consistent runtime version fallbacks across packages.