Commit Graph

66 Commits

Author SHA1 Message Date
Michael Beemer 0bb2ec3154
Merge branch 'main' into add-install-script 2025-03-28 12:47:29 -04:00
Michael Beemer c7e1075ff4
default to $HOME/.local/bin
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-28 16:43:28 +00:00
Michael Beemer c06bcebc52
automatically add to path
Co-authored-by: Kris Coleman <kriscodeman@gmail.com>
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-28 09:26:37 -04:00
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 4a8737edde
Update bin/install.sh
Co-authored-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-23 11:57:42 -04:00
Michael Beemer 334bfb4ee1
Update bin/install.sh
Co-authored-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-23 11:57:06 -04:00
Michael Beemer ad1c649d14
Update bin/install.sh
Co-authored-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-23 11:55:32 -04:00
Kris Coleman 05e094db68
feat: add contributing guide and generator readme (#80)
## This PR

Added a new CONTRIBUTING.md file with detailed instructions on how to
contribute new generators to the project. This includes steps from
forking the repository, implementing the generator logic, writing tests,
registering the generator in CLI, updating documentation, and creating a
pull request.

Also added a README.md in the internal/generators directory explaining
how each generator works. It details about `language.go` and
`language.tmpl` files that are essential parts of each generator along
with an example workflow of how these components interact to generate
code based on OpenFeature flag manifest.

### Related Issues
closes #69

Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
2025-03-18 23:08:49 +00:00
Michael Beemer 5dccfc6280
Merge branch 'main' into add-install-script
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-18 17:06:54 -04:00
Michael Beemer ca14734914
feat: add script to install the lastest binary
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-18 20:16:52 +00:00
OpenFeature Bot 0f4ba1f5a2
chore(main): release 0.3.1 (#84)
🤖 I have created a release *beep* *boop*
---


## [0.3.1](https://github.com/open-feature/cli/compare/v0.3.0...v0.3.1)
(2025-03-18)


### 🐛 Bug Fixes

* binary name referenced in the dockerfile
([0e28e8e](0e28e8ec3b))

---
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>
2025-03-18 20:03:47 +00:00
Michael Beemer 0e28e8ec3b
fix: binary name referenced in the dockerfile
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-18 16:02:02 -04:00
OpenFeature Bot e988d75996
chore(main): release 0.3.0 (#83)
🤖 I have created a release *beep* *boop*
---


## [0.3.0](https://github.com/open-feature/cli/compare/v0.2.0...v0.3.0)
(2025-03-18)


### ⚠ BREAKING CHANGES

* change binary name
([#82](https://github.com/open-feature/cli/issues/82))

### 🧹 Chore

* change binary name
([#82](https://github.com/open-feature/cli/issues/82))
([fdfe561](fdfe561d49))

---
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>
2025-03-18 17:56:23 +00:00
Michael Beemer fdfe561d49
chore!: change binary name (#82)
## This PR

- changes the binary name from `openfeature-cli` to `openfeature`

### Notes

I'm working on an install script and noticed that the binary is
needlessly long.

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-18 15:55:09 +00:00
OpenFeature Bot 67f45c1e28
chore(main): release 0.2.0 (#77)
🤖 I have created a release *beep* *boop*
---


## [0.2.0](https://github.com/open-feature/cli/compare/v0.1.10...v0.2.0)
(2025-03-18)


### ⚠ BREAKING CHANGES

* add init command, update cli flags, support a config file
([#71](https://github.com/open-feature/cli/issues/71))

### 🧹 Chore

* rename the checksum file
([34afca6](34afca62ab))
* upgrade viper to 1.20
([#78](https://github.com/open-feature/cli/issues/78))
([6c36ee9](6c36ee90f7))


### 🔄 Refactoring

* add init command, update cli flags, support a config file
([#71](https://github.com/open-feature/cli/issues/71))
([106bf9d](106bf9ddfe))

---
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>
2025-03-18 13:07:17 +00:00
Michael Beemer 34afca62ab
chore: rename the checksum file
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-18 08:58:23 -04:00
Michael Beemer 555dfb8fd7 add install script
Signed-off-by: Michael Beemer <michael.beemer@dynatrace.com>
2025-03-18 08:19:27 -04:00
Michael Beemer 6c36ee90f7
chore: upgrade viper to 1.20 (#78)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-03-16 11:51:46 -04: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
OpenFeature Bot e430a8dbe6
chore(main): release 0.1.10 (#65)
🤖 I have created a release *beep* *boop*
---


##
[0.1.10](https://github.com/open-feature/cli/compare/v0.1.9...v0.1.10)
(2025-01-27)


###  New Features

* add doc gen, move schema path, add tests, fix react gen
([#68](https://github.com/open-feature/cli/issues/68))
([68a72ee](68a72ee929))
* update golang output
([#63](https://github.com/open-feature/cli/issues/63))
([0e7db02](0e7db0209e))


### 🧹 Chore

* go mod tidy, gitignore dist folder
([1530d38](1530d38dd3))
* switch base image from distroless to alpine
([#67](https://github.com/open-feature/cli/issues/67))
([60955af](60955af1a9))

---
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>
2025-01-27 15:25:53 +00: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
Michael Beemer 60955af1a9
chore: switch base image from distroless to alpine (#67)
## This PR

- switch base image from distroless to alpine

### Notes

The Alpine image makes it much easier to mount local volumes. It's also
used in many other popular CLI as a base image.

### How to test

Build locally and run the container.

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-01-02 14:44:23 -05:00
Michael Beemer 1530d38dd3
chore: go mod tidy, gitignore dist folder
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2025-01-01 18:00:49 +00:00
Florin-Mihai Anghel 0e7db0209e
feat: update golang output (#63)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- updates the golang output for the flag accessors

---------

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-12-09 18:25:21 +00:00
OpenFeature Bot 79b36ddd24
chore(main): release 0.1.9 (#58)
🤖 I have created a release *beep* *boop*
---


## [0.1.9](https://github.com/open-feature/cli/compare/v0.1.8...v0.1.9)
(2024-11-27)


### 🧹 Chore

* remove empty testutils package
([#55](https://github.com/open-feature/cli/issues/55))
([9dc1d9f](9dc1d9fbc3))
* update back to previous mkdir permissions
([#61](https://github.com/open-feature/cli/issues/61))
([515b534](515b5340b5))

---
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>
2024-11-27 19:40:48 +00:00
Florin-Mihai Anghel 515b5340b5
chore: update back to previous mkdir permissions (#61)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
updates back to previous mkdir permissions.
context:
https://unix.stackexchange.com/questions/21251/execute-vs-read-bit-how-do-directory-permissions-in-linux-work

---------

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-11-27 12:42:02 +00:00
Michael Beemer 3f9e20d294
ci: revert to release please 3
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-11-05 21:22:39 -05:00
Michael Beemer f0bef6407f
ci: remove dco workaround
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-11-05 15:59:13 -05:00
Michael Beemer d9d3099f19
ci: update release process (#57)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-11-05 15:42:37 -05:00
Florin-Mihai Anghel 9dc1d9fbc3
chore: remove empty testutils package (#55)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
Removes empty testutils package

---------

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-11-04 13:52:43 +00:00
Michael Beemer 159fa0e9f9
ci: add fallback value to if condition
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-11-01 19:46:49 -04:00
Michael Beemer 62faf21fe3
ci: add lint workflow (#53)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-31 16:40:29 -04:00
Michael Beemer 78bb9e6abc
ci: add merge group as test trigger
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-31 16:37:37 -04:00
Michael Beemer 9e7597faeb
ci: add test workflow (#54)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-31 16:33:31 -04:00
github-actions[bot] 165c6f39a6
chore(main): release 0.1.8 (#51)
🤖 I have created a release *beep* *boop*
---


## [0.1.8](https://github.com/open-feature/cli/compare/v0.1.7...v0.1.8)
(2024-10-31)


### 🐛 Bug Fixes

* docker publishing
([c663816](c663816e33))

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-31 19:43:47 +00:00
Michael Beemer c663816e33
fix: docker publishing
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-31 15:42:54 -04:00
github-actions[bot] 784b8ab63d
chore(main): release 0.1.7 (#50)
🤖 I have created a release *beep* *boop*
---


## [0.1.7](https://github.com/open-feature/cli/compare/v0.1.6...v0.1.7)
(2024-10-31)


### 🐛 Bug Fixes

* docker publishing
([2d24d51](2d24d5141c))

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-31 19:35:56 +00:00
Michael Beemer 2d24d5141c
fix: docker publishing
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-31 15:34:26 -04:00
github-actions[bot] bbc18a91bf
chore(main): release 0.1.6 (#48)
🤖 I have created a release *beep* *boop*
---


## [0.1.6](https://github.com/open-feature/cli/compare/v0.1.5...v0.1.6)
(2024-10-31)


### 📚 Documentation

* switch from code gen to cli
([#47](https://github.com/open-feature/cli/issues/47))
([7a1f9f3](7a1f9f304c))


### 🔄 Refactoring

* change name of go module
([#46](https://github.com/open-feature/cli/issues/46))
([e3058db](e3058db6d7))

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-31 19:29:33 +00:00
Michael Beemer 0e77d287fe
ci: rename released artifacts to cli (#49)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-31 15:23:04 -04: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
Michael Beemer 7a1f9f304c
docs: switch from code gen to cli (#47)
Generalize the project from code gen to CLI.

---------

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-31 19:12:57 +00:00
Florin-Mihai Anghel ce14e1c99c
test: Add tests for golang and react with in memory files (#43)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- adds tests for React and Golang

### Related Issues
https://github.com/open-feature/codegen/issues/42

Fixes #42 

### How to test
`go test ./...` from root folder

---------

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 15:27:04 +00:00
github-actions[bot] 8fa83b0bdb
chore(main): release 0.1.5 (#41)
🤖 I have created a release *beep* *boop*
---


##
[0.1.5](https://github.com/open-feature/codegen/compare/v0.1.4...v0.1.5)
(2024-10-22)


### 🐛 Bug Fixes

* container copy command
([#40](https://github.com/open-feature/codegen/issues/40))
([8448543](8448543fda))

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-22 15:15:56 -04:00
Michael Beemer 8448543fda
fix: container copy command (#40)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-22 15:10:21 -04:00
github-actions[bot] 630f73027b
chore(main): release 0.1.4 (#39)
🤖 I have created a release *beep* *boop*
---


##
[0.1.4](https://github.com/open-feature/codegen/compare/v0.1.3...v0.1.4)
(2024-10-22)


###  New Features

* add version command
([#38](https://github.com/open-feature/codegen/issues/38))
([c13a448](c13a4486b9))

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-22 15:00:56 -04:00
Michael Beemer c13a4486b9
feat: add version command (#38)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-22 14:59:59 -04:00
Michael Beemer 4b329dc9cb
ci: add docker publish (#37)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-22 14:37:28 -04:00
github-actions[bot] 7d619ad23c
chore(main): release 0.1.3 (#35)
🤖 I have created a release *beep* *boop*
---


##
[0.1.3](https://github.com/open-feature/codegen/compare/v0.1.2...v0.1.3)
(2024-10-22)


### 🐛 Bug Fixes

* set github token for release process
([a2fe4aa](a2fe4aa33e))

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-22 13:40:56 +00:00
Michael Beemer a2fe4aa33e
fix: set github token for release process
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2024-10-22 09:39:06 -04:00