Java expects to have a class with the same name as the file within the file. This constraint was violated, and renaming the class ort the file was needed
* feat: add compare command to cli
A new 'compare' command has been added to the CLI. This command allows users to compare two manifest files and list the changes between them. The comparison is done by loading each manifest file, then using a new function from the 'manifest' package to identify differences. Error handling has also been implemented for scenarios where loading or comparing manifests fails. Tests were also included to test the compare function.
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* feat: adds tree behavior to compare cmd
Compare now supports flat, tree, and color output modes.
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* chore: refactors compare command flag handling
Refactors the compare command to use the global manifest
flag and introduces an 'against' flag for specifying the
target manifest for comparison.
This change simplifies command usage and aligns it with
other commands that utilize the global manifest configuration.
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* feat: Adds output formats to compare
Adds the ability to render the differences between manifests in JSON format,
providing a structured output suitable for consumption by other tools or
systems. Also, introduces validation for the output format flag.
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* feat: adds yaml output format
Adds the ability to output manifest comparison results in YAML format.
This provides users with another option for viewing and processing
the differences between manifests, which can be useful for
configuration management and automation tasks.
The changes include:
- Implementation of a new render function for YAML output.
- Modification of the output format selection logic to include YAML.
- Addition of YAML as a valid output format option in the command
line interface and documentation.
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
---------
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* feat: introduce dagger for integration testing and ci
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* feat: make integration testing extensible and modular
my intention here is to make the pattern for integration testing more accessible.
let's abstract the integration test pattern itself into a framework to harness the boiler plate.
then reuse our csharp integration test code as our first integration-test.
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
---------
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
feat: integrates pre-commit and pre-push hooks to automate standards
Adds Lefthook configuration to automate Git hooks, ensuring consistent pre-commit & pre-push checks.
Lefthook automates pre-commit checks such as code formatting and pre-push checks to ensure documentation and tests are up-to-date.
This helps maintain code quality and consistency across the team. I find this saves me time as I switch projects and standards, so I don't push and wait for a PR check to fail.
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* feat: adds c# generator
Adds a new generator for C# to create typesafe clients.
This allows users to generate C# code based on feature flag
definitions, streamlining integration with .NET applications.
Includes necessary command-line flags, templates, and tests.
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* feat(csharp): adds C# generator integration test
Adds a C# code generator integration test to ensure the generated C# code compiles correctly.
This includes:
- A new C# generator based on templates
- Updates to the build process and documentation to support C# generation and testing
- An integration test using Docker to compile the generated C# code
- Fixes and adjustments to data type mappings for C# compatibility
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* chore: go fmt fixes
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* Update .github/workflows/csharp-integration.yml
Co-authored-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* Update CONTRIBUTING.md
Co-authored-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* Update internal/generators/csharp/csharp.go
Co-authored-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* chore(ci): moved the csharp integration into pr-test workflow as a separate job
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* chore: cleaned up generate code to private funcs are private
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* feat(csharp): implemented di for generated code
- updated openfeature to 2.3.2
- introduced IServiceCollection and DI patterns
- updated tests and expectations
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
* Update .github/workflows/pr-test.yml
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Signed-off-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
* Update .github/workflows/pr-test.yml
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Signed-off-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
---------
Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
Signed-off-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
Co-authored-by: André Silva <2493377+askpt@users.noreply.github.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
* feat: add nodejs generator
Signed-off-by: Michael Beemer <michael.beemer@dynatrace.com>
* feat: add a nodejs generator
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
* improve doc diff output
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
* check out expected sha
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
* fix variable name
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
* feat: consolidate logging and support debug flag
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
* regenerate docs
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
---------
Signed-off-by: Michael Beemer <michael.beemer@dynatrace.com>
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
## This PR
- add a script to install the latest binary
### Notes
This is a modified version of the script used in
[Vacuum](https://github.com/daveshanley/vacuum/blob/main/bin/install.sh).
I've tested it locally on Ubuntu in WSL2 with an X86 cpu.
### Follow-up Tasks
Once we've verified it works, I'll update the readme to include an
install section.
---------
Signed-off-by: Michael Beemer <michael.beemer@dynatrace.com>
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Kris Coleman <kris.blacksuitmedia@gmail.com>
Co-authored-by: Kris Coleman <kriscodeman@gmail.com>
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>
## 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>
## 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>
## 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>