Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

[FEATURE]: Input variables #4502

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

Closed
asbjornu opened this issue Apr 16, 2025 · 0 comments
Closed

[FEATURE]: Input variables #4502

asbjornu opened this issue Apr 16, 2025 · 0 comments
Labels

Comments

@asbjornu
Copy link
Member

asbjornu commented Apr 16, 2025

Regarding #4456, it seems like we have an increasing need in the community to affect the input to GitVersion in order to control how it generates its output.

As we already have a set of standardized "output variables", so perhaps we should establish a new concept around "input variables" as well?

These input variables could either be defined as environment variables, or as JSON, just like the output variables currently work. We already have Git_Branch which we need to keep for backwards compatibility, but I think we should namespace the environment variables with GitVersion_ just like we do for the output variables.

Specific use-cases for input variables would be build agent, but eventually I hope that GitVersion can be executed on a static JSON input file (piped from another GitVersion command, as discussed in #2275) and that the static JSON contains absolutely everything required for GitVersion to calculate a version number, regardless of how it's configured. Sort of like:

  1. gitversion prepare → Prepares and validates the JSON input document we are discussing now. This step is optional and can be replaced with a static and guaranteed valid JSON input document.
  2. gitversion execute → Reads the JSON input document, the configuration file, and produces a JSON file representing the current state of the repository.
  3. gitversion calculate → Reads the JSON state file from step 2 and performs the version calculation. The result is a JSON output document.

I'm not set on the naming or details, but I hope the above is sufficient to understand the general idea and to foster further discussions.

@GitTools GitTools locked and limited conversation to collaborators Apr 16, 2025
@asbjornu asbjornu converted this issue into discussion #4503 Apr 16, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

1 participant