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

feat: fully version schema #163

Merged
merged 1 commit into from
May 27, 2024
Merged

feat: fully version schema #163

merged 1 commit into from
May 27, 2024

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented May 27, 2024

This PR

  • adds full versioning to the json schema (meaning the $id now has a full version string in it, like: https://flagd.dev/schema/v0.2.5/flags.json)
  • adds automation to update this with new releases of the json module
    • note there's no way to use the traditional release please versioning with comment to update a substring of a json value, so I've had to hack that in myself.

Next steps will be to:

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
@toddbaert toddbaert requested a review from a team as a code owner May 27, 2024 20:04
Comment on lines +80 to +90
make gen-schema-json
if [ ! -z "$(git status --porcelain)" ]; then
echo "JSON schema generation produced diff, regenerating and committing result...";
git config --global user.name "validate-and-sync-schema-job"
git config --global user.email "bot@openfeature.dev"
git add json/*.json
git commit -m 'chore: sync json schema from yaml' -s
git push
else
echo "No delta between YAML and JSON schemas, finishing..."
fi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a diff, this regenerates the JSON from the YAML, and commits is back - this way when release please updates the YAML files based on the x-release-please comment, it regenerates the JSON files to match. I tested it out here.

@toddbaert toddbaert changed the title fix: fully version schema feat: fully version schema May 27, 2024
Copy link
Contributor

@Kavindu-Dodan Kavindu-Dodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example PR looks promising 👍

@toddbaert toddbaert merged commit c0692e4 into main May 27, 2024
14 checks passed
@toddbaert toddbaert deleted the fix/a-thing branch May 27, 2024 21:43
toddbaert pushed a commit that referenced this pull request May 27, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>json/json-schema: 0.2.6</summary>

##
[0.2.6](json/json-schema-v0.2.5...json/json-schema-v0.2.6)
(2024-05-27)


### ✨ New Features

* fully version schema
([#163](#163))
([c0692e4](c0692e4))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
Signed-off-by: validate-and-sync-schema-job <bot@openfeature.dev>
Co-authored-by: validate-and-sync-schema-job <bot@openfeature.dev>
toddbaert added a commit that referenced this pull request Jun 17, 2024
Reverts #163. Though
there's a lot of benefits, the maintenance burden here is too high.

It means we will need to update the schema version everywhere,
frequently. For example, we'd have to update it in places like this:
https://github.com/open-feature/java-sdk-contrib/blob/ae21165c2bd65cad325e66e8373fe38da8a98baf/providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/model/FlagParser.java#L46-L47
.

I think this will be too error prone and too much of a maintenance
burden for little benefit. I'm reverting back to only major
version-based versioning.

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants