Skip to content
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

Include v prefix in extra-files #2160

Closed
krak3n opened this issue Dec 10, 2023 · 2 comments
Closed

Include v prefix in extra-files #2160

krak3n opened this issue Dec 10, 2023 · 2 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@krak3n
Copy link

krak3n commented Dec 10, 2023

Hi

I have a yaml file I would like to bump in the extra-files config like this:

{
  "release-type": "go",
  "packages": {
    ".": {}
  },
  "extra-files": [
    "version.go",
    {
      "type": "yaml",
      "path": "buf.plugin.yaml",
      "jsonpath": "$.plugin_version"
    }
  ]
}

This needs to include a v prefix on the version but I cannot see a configuration option to be able to set that. The yaml it generates is:

version: v1
 name: plugin-name
 plugin_version: 1.0.0
 source_url: https://github.com/repo-url
 output_languages:
   - go

For buf.build this is not a valid semantic version as it does not include the v prefix and so the pushing of the plugin is rejected.

What I would like release please to generate is this:

version: v1
 name: plugin-name
 plugin_version: v1.0.0
 source_url: https://github.com/repo-url
 output_languages:
   - go

Is this possible?

@krak3n krak3n added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Dec 10, 2023
@chingor13
Copy link
Contributor

Using the GenericYaml updater, it is not possible to include the v in the string. It might be possible to add an option to it to allow adding the v.

As a workaround, you can use a plain Generic updater which uses annotations in code. It will look for a semver-like string and replace that part, leaving the remaining text around it untouched. To use this, just pass the file path (like you have for version.go) to extra-files rather than the json object config.

You could do something like:

version: v1
 name: plugin-name
 plugin_version: v1.0.0 # x-release-please-version
 source_url: https://github.com/repo-url
 output_languages:
   - go

@chingor13 chingor13 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
@nick-marnik
Copy link

I guess this issue is technically a duplicate, but I wanted to reference a similar issue posted here: #1344

I think it is important to note that the solution provided by @chingor13 doesn't work due to the requirement of v in the version string.

I hope to get a fix on the linked issue as I am still seeing this issue because the workaround proposed in #1344 only works for markdown files, not raw YAML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants