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

Design a generic subtract plugin #672

Closed
8 of 10 tasks
Tracked by #656
zanete opened this issue Apr 29, 2024 · 6 comments · Fixed by Green-Software-Foundation/if-plugins#90
Closed
8 of 10 tasks
Tracked by #656

Design a generic subtract plugin #672

zanete opened this issue Apr 29, 2024 · 6 comments · Fixed by Green-Software-Foundation/if-plugins#90
Assignees
Milestone

Comments

@zanete
Copy link

zanete commented Apr 29, 2024

Sub of: #656

What
Create a new generic subtract plugin in 'if-plugins`

Why
We want to support as many pipelines as possible using generic plugins that can be adapted to many use cases. We currently have sum, multiply, coefficient. We also need to support subtract.
As a user I want to be able to execute any arbitrary logic using if plugins.

Prerequisites/resources
None

SoW (scope of work)

  • plugin code is added to if-plugins repo
  • documentation updated to if-plugins repo
  • documentation is added to if.greensoftware.foundation
  • unit tests added, giving 100% coverage and passing
  • manifests are added to if repo demonmstrating usage

Note the plugin code can be copied from the sum plugin and modified to subtract rather than add.

Acceptance criteria

  • A plugin called Subtract exists in the if-plugins repository
    Given (Setup): the subtract plugin exists
    When (Action): a user has downloaded and installed if and if-plugins
    Then (Assertion): the user should be able to include subtract in a pipeline and subtract any parameter that exists in their input data from any other parameter in their input data.

  • Unit tests exists with 100% coverage over subtract
    Given (Setup): a user has downloaded and installed if-plugins
    When (Action): a user runs npx jest --coverage
    Then (Assertion): the coverage report should show that subtract is 100% covered and passing

  • Documentation exists in plugin readme
    Given (Setup): the user visits the if-plugins repository
    When the user navigates to src/lib/subtract
    Then the user sees a README containing documentation describing the subtract plugin, copying the format from the other plugin readmes.

  • Documentation exists in if.greensoftware.foundation
    Given: the user is on if.greensoftware.foundation
    When (Action): they navigate to reference/plugins and find the subtract plugin section
    Then (Assertion): they see a link to the plugin readme for the subtract plugin

  • Example manifests exists
    Given: the user has downloaded and installed if
    When (Action): the user navigates to if/manifests/plugins
    Then (Assertion): they see manifests that include the subtract plugin

@zanete zanete moved this to In Design in IF Apr 29, 2024
@zanete zanete added this to the Plugin Registry milestone Apr 29, 2024
@zanete zanete mentioned this issue Apr 29, 2024
28 tasks
@jmcook1186 jmcook1186 moved this from In Design to Ready in IF Apr 29, 2024
@jmcook1186 jmcook1186 moved this from Ready to In Refinement in IF Apr 29, 2024
@jmcook1186
Copy link
Contributor

@zanete @pazbardanl
please take a look at the ticket - I consider this ready to work on.

@zanete
Copy link
Author

zanete commented Apr 29, 2024

@jmcook1186 , that's awesome, very quick work! All of the scenarios make sense apart from the first one. Perhaps this is because I'm really new to the framework and have n't used it myself, I'm a bit confused about what you'd expect to happen.
I'd recommend phrasing it so that the Given is a precondition, When is the trigger and Then is all that happens, for example:
Given A User has downloaded and installed if and if-plugins
When User executes a pipeline that contains subtract
Then The framework subtracts any parameters ... etc,

You could even be more specific about the use of the subtract and add multiple pipeline examples in a table and the corresponding outputs you expect. This would show a few ways you'd envisage the plugin to be used and what the behaviour for each case should be
e.g.
Given A User has downloaded and installed if and if-plugins
When User executes the pipeline defined in the table
Then The framework outputs the results as defined in the table for the corresponding row

ID Pipeline Results
1 pipeline 1 results 1
2 pipeline 2 results 2
3 pipeline 3 results 3

cc @pazbardanl @jawache

@pazbardanl
Copy link
Contributor

hi @zanete / @jmcook1186 can i get a hint / pointer on this:
documentation is added to if.greensoftware.foundation
which repo is that? thanks :)

@jmcook1186
Copy link
Contributor

Hi @pazbardanl you can add dosc to if.greensoftware.foundation by raising PRs against the if-docs repo (https://github.com/Green-Software-Foundation/if-docs).
All that is required there is to add the link to the plugin README file on https://if.greensoftware.foundation/reference/plugins following the format of the other plugins.

@pazbardanl pazbardanl moved this from In Refinement to Pending Review in IF May 7, 2024
@zanete zanete moved this from Pending Review to In Progress in IF May 7, 2024
@pazbardanl pazbardanl moved this from In Progress to Pending Review in IF May 7, 2024
@jawache
Copy link
Contributor

jawache commented May 7, 2024

Thanks for this @pazbardanl, great work.

And @zanete that's a great idea, generally I think it's good for plugin ACs to just be manifest files that people can run so there is no ambiguity, but if there are lots of edge cases it can save a lot of time if it's just a table, given this manifest file, if you replace the values according to those in this table then it should output the last col etc...

@zanete zanete moved this from Pending Review to Testing in IF May 20, 2024
@zanete
Copy link
Author

zanete commented May 20, 2024

@manushak please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants