bazel-contrib / bazel-contrib/rules-template

publish.yaml does not stamp properly

Open
#155 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
100
Forks
34
PR merge metrics
No merged PRs in 30d

Description

It appears that after https://github.com/bazel-contrib/rules-template/commit/fb992e13e2d205f34ce35496722340a25b11d4e8, stampVersion at https://github.com/bazel-contrib/publish-to-bcr/blob/6a577a5c83afe8461b36f08dd3ca3ab2ac1f12f2/src/domain/module-file.ts#L35 no longer works properly.

Here's a sample stdout from the Github Action:

https://github.com/bazel-contrib/rules_devicetree/actions/runs/16453092376/job/46503690621

```
Loading template files from /tmp/templates-3tj8oi
Creating entry for module version 0.1.1 in bazel-central-registry
Fetching release archive https://github.com/bazel-contrib/rules_devicetree/releases/download/v0.1.1/rules_devicetree-v0.1.1.tar.gz
The release archive's MODULE.bazel version ",
#
# Always leave version unset or set to does not match release version 0.1.1. Creating a version patch.
Successfully created entry for rules_devicetree@0.1.1
```

However, the generated file does NOT have the proper version stamped:

https://github.com/bazelbuild/bazel-central-registry/pull/5315/commits/0e9a7f04c24f30d671f9de57a8a6ecd13a9aa293

It is stamped at the comments:

```
# NOTE:
# version = "0.1.1",
```

So, either stampVersion needs to be fixed, or we need to have an explicit `version = ""` line without the leading `#`.

Contributor guide

Open the contributing guide

Research direction

Start at stampVersion in src/domain/module-file.ts and compare its behavior with the generated MODULE.bazel shown in the issue. Reproduce using the linked GitHub Actions run and release archive. Done means the release version is written to the intended MODULE.bazel version line rather than inserted into the commented template text.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.