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

[Feature Request] Add JSON schema to help configure 'GitVersion.yml' #2874

Closed
BinToss opened this issue Oct 10, 2021 · 12 comments · Fixed by #3399
Closed

[Feature Request] Add JSON schema to help configure 'GitVersion.yml' #2874

BinToss opened this issue Oct 10, 2021 · 12 comments · Fixed by #3399
Assignees
Labels
Milestone

Comments

@BinToss
Copy link
Contributor

BinToss commented Oct 10, 2021

Detailed Description

GitVersion only has a JSON schema for the output JSON, but it lacks one for the input YAML/JSON config.

Context

I've found that going back and forth between the documentation and the config file I'm editing takes up more time than it could if my editor was able to detect a schema and use that to suggest properties and values. It wouldn't be perfect, but nothing is.

@asbjornu
Copy link
Member

Sounds like a great idea! Is this something we could make editors such as Visual Studio Code use for code completion and such as well?

@BinToss
Copy link
Contributor Author

BinToss commented Oct 13, 2021 via email

@BinToss
Copy link
Contributor Author

BinToss commented Oct 13, 2021 via email

@asbjornu
Copy link
Member

Where is this existing GitVersion.json schema located?

@BinToss
Copy link
Contributor Author

BinToss commented Oct 14, 2021

https://json.schemastore.org/gitversion.json
I'm not sure where it came from or who made it.

@arturcic
Copy link
Member

@BinToss I think the schema is versioned here https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/gitversion.json. A PR there should add the missing parts

@BinToss
Copy link
Contributor Author

BinToss commented Nov 7, 2021 via email

@asbjornu
Copy link
Member

asbjornu commented Nov 8, 2021

I have no idea how this works, but your suggested solution sounds good @BinToss. I suppose that's up to @SchemaStore, though?

@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 2, 2022
@stale stale bot closed this as completed Apr 16, 2022
@BinToss
Copy link
Contributor Author

BinToss commented Apr 19, 2022

I recently learned that one can specify a JSON schema via a "$schema" property in the JSON/YAML file. This property allows both URLs and local file paths. The schema filename can be different than the current file's name.

This means that the filenames of GitVersion.yml and GitVersion.json do not need to be changed.

Example

https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json

Documentation

https://json-schema.org/draft-04/json-schema-core.html#rfc.section.6


Consequently, we now have three more solutions for GitVersion.json and GitVersion.yml:

  • host both files' schemas in a GitVersion-owned repo or branch and access them remotely.
  • package both schemas with GitVersion, copy them to be alongside their respective json/yml, and write the relative path to those files.
  • Generate the schemas during runtime based on what's available in the currently executing GitVersion assembly.

GitVersion CLI is already capable of generating and configuring a config file. Depending on how that's implemented, also generating a schema should be relatively easy.

@asbjornu
Copy link
Member

host both files' schemas in a GitVersion-owned repo or branch and access them remotely.

I like this option and think we should expose them through the website on gitversion.net. A PR adding GitVersion.json and GitVersion.yml to the website would be appreciated.

@asbjornu asbjornu reopened this Apr 19, 2022
@stale stale bot removed the stale label Apr 19, 2022
@arturcic arturcic added this to the 6.x milestone Feb 25, 2023
@arturcic arturcic self-assigned this Feb 25, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
…e json schemas

GitTools#2874 - added GitVersion.Scheme console that will generate the json schemas
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Feb 26, 2023
@arturcic arturcic modified the milestones: 6.x, 6.0.0-beta.1 Mar 2, 2023
@arturcic
Copy link
Member

arturcic commented Mar 2, 2023

🎉 This issue has been resolved in version 6.0.0-beta.1 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

arturcic added a commit that referenced this issue Mar 5, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants