Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
rinzler-17 committed Sep 22, 2022
1 parent 05983c6 commit 1c69f66
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,29 @@ make git_run

Note : Both docker and git pulls latest version of openapi generator.

## Adding complex workflows:
Complex workflows requiring multiple granular, autogenerated apis can be implemented as part of Operator classes. These classes are included in the path _equinix-openapi-metal/src/main/java/com/equinix/workflow_ when building the sdk.
## Contribution guidelines
### Patching oas3.0 spec
1. Make changes in ``spec/oas3.patched.json``.
2. Create a patch file in metal-java:
```
cd spec
git diff oas3.patched.json > ../patches/spec.fetched.json/<patchfilename>
cd ..
```
3. ``patchfilename`` should be in format: ``<patch_index>-<short_patch_decription_or_identifier>.patch``
4. Run ``make docker_run`` to reapply the changes to oas spec.
5. Before pushing changes, commit ``spec/oas3.patches.json`` along with the patch file.

## Steps for development:
### Adding complex workflows
Complex workflows requiring multiple granular, autogenerated apis can be implemented as part of Operator classes. These classes are included in the path ``equinix-openapi-metal/src/main/java/com/equinix/workflow`` when building the sdk. An example use case for operator implementation can be for APIs requiring polling logic to fetch updated resource state.
1. Follow steps mentioned in section "Generate and build equinix metal java client" to generate and build the sdk in your cloned local.
2. Implement operator classes inside ```equinix-openapi-metal/src/main/java/com/equinix/workflow```.
3. Follow steps mentioned in section "Functional tests for complex workflows" to add functional tests for the same.
4. After testing and debugging in your local, move the newly added operator classes to _internal/workflow_.
4. After testing and debugging in your local, move the newly added operator classes to ``internal/workflow``.
5. Commit your changes made in ```internal/workflow```, ```.github/workflows```, ```equinix-functional-tests``` and push them to the remote branch. The auto commit git workflow would automatically build and generate the sdk in the remote branch with the newly added workflows.
6. Post completion of the auto commit workflow in your remote branch, you can do a ```git rebase origin/your-branch-name``` to sync your local.

## Functional tests for complex workflows:
### Adding functional tests for complex workflows
1. You can implement functional tests for your operator classes inside ```equinix-functional-test/src/test/java/com/equinix/test/functional```. Check existing operator test implementations for reference.
2. Input properties required for the tests can be mentioned in a separate .properties file inside ```equinix-functional-test/src/test/resources```.
3. To run functional tests locally:
Expand Down

0 comments on commit 1c69f66

Please sign in to comment.