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

Add delete tag to CLI #61

Open
bethesque opened this issue Jan 13, 2020 · 5 comments
Open

Add delete tag to CLI #61

bethesque opened this issue Jan 13, 2020 · 5 comments

Comments

@bethesque
Copy link
Member

No description provided.

@sirfilip
Copy link

Hello @bethesque

Love what you have done and want to help anyway i can.

@bethesque
Copy link
Member Author

bethesque commented Jun 15, 2020

That would be awewsome @sirfilip! A few people have asked for this recently.

It's a pretty old project, and my preferences for code architecture have changed over the years, so despite the fact that you'll see a variety of ways of implementing the commands, can you follow the pattern used for create-or-update-pacticipant. You'll find the CLI definition here and the command implementation here

To keep the API as flexible as possible, I like to use the HAL relations to find resources rather than hard coding URLs. You'll find the relation for the version tag by following the pb:pacticipant relation from the index, and then sending a delete to the pb:version-tag relation.

The command should not throw an error if the tag does not exist (that is, a 404 is returned by the delete call), but it should print out a message indicating whether or not it existed.

The options should match those for the create-version-tag here

Obviously, write tests for the new code, and try to follow the general style. You'll also need to write a Pact test for the deletion 😆

Let me know if you have any questions. I'm in Australia, so the time difference might mean I'm a bit slow to respond however - sorry about that!

@sirfilip
Copy link

Thanks @bethesque you responded supper fast.

It will be my pleasure.

@sirfilip
Copy link

Hmm i cant get the tests to become green is there dev setup that i should follow. I am getting

PactBroker::Client::Error:
              {"message":"No interaction found for GET /matrix?q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&latestby=cvp&latest=true&tag=prod","interaction_diffs":[{"description":"a request for the compatibility matrix for Foo version 1.2.3 and the latest prod versions of all other pacticipants","provider_state":"the pact for Foo version 1.2.3 has been successfully verified by Bar version 4.5.6 (tagged prod) and version 5.6.7","query":{"EXPECTED":"q[][pacticipant]=Foo&q[][version]=1.2.3&latestby=cvp&latest=true&tag=prod","ACTUAL":"q%5B%5D%5Bpacticipant%5D=Foo&q%5B%5D%5Bversion%5D=1.2.3&latestby=cvp&latest=true&tag=prod"}}]}

I believe that i am missing mock server running but not sure that it is the case

@bethesque
Copy link
Member Author

No dev set up apart from bundle install. Make the PR so I can see the running code on Travis.

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

No branches or pull requests

3 participants