Commit Graph

8 Commits

Author SHA1 Message Date
Kris Coleman 9102d1390a
feat(cli): add stability annotations to generated Markdown documentation (#88)
closes #87

## This PR

This update introduces the addition of stability information to the
generated markdown content for commands in our CLI. The changes include
a new function, `addStabilityToMarkdown`, which checks if a command has
a 'stability' annotation and adds it to the markdown content
accordingly. This function is then used in both `generate.go` and
`init.go`. Additionally, formatting adjustments were made in `root.go`
for better readability.

### Notes
- Some of the logic felt a bit astonishing, so I left a lot of comments.
If this isn't helpful, I'd be happy to remove them.
- I tried to approach this in a way where the addedStabilityInfo was
inherent and not imperative.
- There is still one imperative func that needs to be used in each
command, I would be open to suggestions to eliminate it.
- The logic for customizing the markdown should work for any command we
implement in the future.
- I was going to try and use go templating to achieve this, but ended up
going with a 'mutate after the fact' approach.
- This approach could be utilized in the future to customize the docs
further, but the logic to do so is very procedural. In the future, I
would like to think up a more declarative approach, I think this could
improve it so it's more easily extensible and less to maintain.

### Follow-up Tasks
- Possibly introduce a more declarative approach so we can extend
markdown customization more easily in the future, without having to
write additional logic to figure out where to place the custom content.

### How to test
- [ ] run `make generate-docs` and you should see the stability info
output in the docs. Change or add a new stability info to a command, try
it, and you should see the changes updated.

Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
2025-03-27 19:20:36 +00:00
Michael Beemer 106bf9ddfe
refactor!: add init command, update cli flags, support a config file (#71)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-14 16:12:26 -04:00
Michael Beemer 68a72ee929
feat: add doc gen, move schema path, add tests, fix react gen (#68)
## This PR

- moves JSON schema to a dedicated directory
- added schema validation tests
- fixed React code gen (and tests)
- automate CLI doc generation
- Loosen JSON schema
- ~~Rename default value~~

### Related Issues

Fixes #66

### Notes

It's a big PR that I could break into smaller changes if necessary.

---------

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Signed-off-by: Michael Beemer <michael.beemer@dynatrace.com>
2025-01-27 15:20:19 +00:00
Florin-Mihai Anghel e3058db6d7
refactor: change name of go module (#46)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
Changes the name of the go module

### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->

Fixes #45

---------

Signed-off-by: Florin-Mihai Anghel <fanghel@google.com>
Signed-off-by: Florin-Mihai Anghel <44744433+anghelflorinm@users.noreply.github.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-31 19:15:05 +00:00
Florin-Mihai Anghel fbac8ce70d
refactor: change the case of the flag manifest to camel case. (#19)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
Changes the case of the flag manifest to camel case.

---------

Signed-off-by: Florin-Mihai Anghel <fanghel@google.com>
Signed-off-by: Florin-Mihai Anghel <44744433+anghelflorinm@users.noreply.github.com>
2024-10-01 11:31:48 +00:00
Florin-Mihai Anghel aa9d3b03f0
refactor: embed flag manifest schema into code and moves files around (#18)
## This PR
embeds flag manifest schema into code and moves files around

---------

Signed-off-by: Florin-Mihai Anghel <fanghel@google.com>
Signed-off-by: Florin-Mihai Anghel <44744433+anghelflorinm@users.noreply.github.com>
2024-09-30 09:50:45 +00:00
Michael Beemer ed844b43a3
feat!: lower json schema version, rename number to float (#12)
## This PR

- lowers json schema version to draft-07
- renames number property to float

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-09-10 07:31:16 +00:00
Florin-Mihai Anghel fac35caff8
docs: Add initial flag manifest schema (#9)
## This PR
Defines a new format for a flag manifest input to the codegen tool, as
defined in a JSON schema

### Related Issues

Fixes https://github.com/open-feature/codegen/issues/1

### Notes
Is based on
https://docs.google.com/document/d/19GQpSNcLnDEbzJRL6FpzKHFEQWVGNrgNK25lC4-JuE8/edit#heading=h.f1glu5dk43k9

---------

Signed-off-by: Florin-Mihai Anghel <fanghel@google.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-08-27 14:50:13 +00:00