Customized explicit job requirements are doubled after replication

Issue #24 resolved
Former user created an issue
  1. Suppose you have a template with an explicit job requirement of the form SomeCapability exists.
  2. Then in some plan you narrow down this requirement to SomeCapability matches regex.
  3. After replication you'll get bot of them. Which is not a valid case from the Bamboo point of view (you can't create more than one requirement with the same capability - at least from UI).

I haven't tested other customization cases. But I suggest the capability should be a key and you shouldn't add/overwrite an already existing requirement.

Comments (28)

  1. Andrew Nefedkin Account Deactivated

    Thanks, that works fine now.

    Only one thing. It looks strange to me that such a replication only occurs if Template Tasks Definition is checked. Those are explicit requirements and they do not deal with any tasks.

  2. Hutuleac Iulius repo owner

    Hi Andrew,

    that works as designed. I never encountered such scenario like yours but give me a bit of time, I will see how I can decouple.

    Julius

  3. Hutuleac Iulius repo owner

    Ok Andrew,

    will publish in a few moments a version that will allow requirement merging without tasks. If tasks are not selected I will merge custom capabilities and skip the task requirements from the template since the task is not copied, no point to copy its requirement.

    Does this sound ok to you ?

    Julius

  4. Andrew Nefedkin Account Deactivated

    Thank you, Julius for the update.

    Unfortunately I can't see any changes in the behavior. Missed requirement doesn't get added.

  5. Hutuleac Iulius repo owner

    Hi Andrew,

    I am afraid I dont understand what you would like to achieve in this case.

    Can you put in a short description the data, maybe screenshots and what would you expect to get.

    Example:

    Scenario 1:

    Template:

    REQ1 = 1

    JOB using Template

    REQ1 matches .*

    After replication JOB should have:

    REQ1 matches .*

    Scenario 2:

    Template:

    REQ1 = 1

    JOB using Template

    REQ1 undefined

    After replication JOB should have:

    REQ1 = 1

    Julius

  6. Hutuleac Iulius repo owner

    Hi Andrew,

    or did you mean you disabled the tasks replication and requirement replication is still not happening even after updating the plugin ?

    Julius

  7. Hutuleac Iulius repo owner

    Hi Andrew,

    had another review of the code, found one small issue that might have blocked requirement replication when tasks are not replicated.

    I published a new version, I hope this is what you actually needed.

    Julius

  8. Andrew Nefedkin Account Deactivated

    Hi Julius.

    Well... yes and no. Now it is even worst. Explicit requirements are OK, but all implicit reqs are completely vanished!

  9. Andrew Nefedkin Account Deactivated

    Another one caveat exists.

    If there are two tasks in a job which have the same requirement then after replication only one of them remains.

    Please note: implicit requirements are dictated by tasks themselves and never should have duplicated collapsed. Unlike explicit ones.

  10. Andrew Nefedkin Account Deactivated

    I'm afraid current behavior would disappoint users.

    Shouldn't there be a new Template Explicit Requirements checkbox alongside the Tasks one?

    My current use cases always require to copy them but who knows what other users need?

  11. Hutuleac Iulius repo owner

    Hi Andrew,

    lets take it slow then:

    explicit you say are ok now implicit functionality should be as follows: - copy only if we replicate the actual tasks - retain requirements of job tasks

    Julius

  12. Andrew Nefedkin Account Deactivated

    You are right. And do not touch implicit reqs in case tasks are not replicated.

  13. Hutuleac Iulius repo owner

    So you would like me to revert the change and only replicate requirement when tasks are replicated, as in the original ?

  14. Andrew Nefedkin Account Deactivated

    Hmm, to me the ideal scenario wold be as following:

    1. Explicit requirements are always replicated (unless we have a separate checkbox which controls this). Overwrite or merge is controlled by existing checkbox Merge Job Requirements. Do not produce duplicates of a capability.
    2. Implicit requirements a replicated as it was before the changes: thus controlled by Template Tasks Definition and Merge Job Requirements. All of them, even having duplicate capabilities.
  15. Hutuleac Iulius repo owner

    Hi Andrew,

    I am still testing various options, it looks good until now.

    Until now I tested:

    • using manual capabilities and updating them in the jobs making sure they dont get overwritten from templates
    • plugin requirements replication from template when task replication is enabled
    • disabling tasks in templates, making sure requirement is not affected in the jobs, if task is still enabled in the job
    • disabling requirement replication and enabling task replication only, ensuring requirements are replicated in this case

    Seems I took requirement replication a bit too lightly in my original design, there are a lot of scenarios.

    Feel free to update and test on your setup also.

    Julius

  16. Andrew Nefedkin Account Deactivated

    Hi Julius.

    Still some bad news after testing the latest version. Let me illustrate with some screenshots this time.

    #Plan 1# ##Tasks## plan1_tasks.jpg ##Requirements tab after replication## plan1_reqs.jpg

    #Plan 2# ##Tasks## plan2_tasks.jpg ##Requirements tab after replication## plan2_reqs.jpg

    As you can see, identical implicit requirements from tasks of the same type but with different names are cut off - only one of them exists.

    Explicit requirements replication seems to be OK.

  17. Hutuleac Iulius repo owner

    So one case left it seems, how to handle duplicate requirements. In your case Plan 1 is the template and Plan 2 is the copy ?

    At the moment there is one filter left for duplicates, I am attempting to ensure the job existing requirements do not duplicate template requirements but for some reason is not working for you, something like:

    newreqs = templatereqs + (jobreqs-templatereqs)

    I will try to recreate your entire build plan later today with template and child and see how I convince it to copy the duplicates.

    Julius

  18. Andrew Nefedkin Account Deactivated

    In your case Plan 1 is the template and Plan 2 is the copy ?

    No, they are both real plans each having their own templates (different).

  19. Hutuleac Iulius repo owner

    Ok,

    so it means the duplicate filter is impacting you. I will have a look, I tough I included in the compare every single attribute but seems I missed something.

    Or the requirement is perfectly identical just the task name is different, in that case if you really want the duplicated requirement I can try to allow the duplicates (maybe add a checkbox)

    Julius

  20. Andrew Nefedkin Account Deactivated

    I will try to recreate your entire build plan later today with template and child and see how I convince it to copy the duplicates.

    But notice these plans have Template Tasks Definition switched off. Therefore implicit requirements shouldn't be touched at all.

    Or the requirement is perfectly identical just the task name is different

    Yes, you are right.

    in that case if you really want the duplicated requirement

    This is not my case but rather the Bamboo behaves that way. If I go to the tasks and re-save them then there are "duplicates" from all tasks appear.

  21. Hutuleac Iulius repo owner

    I noticed the tasks are untouched.

    I will try to allow those particular duplicates as the original is from another taskId within same job.

    Julius PS: I should make a slack :)

  22. Hutuleac Iulius repo owner

    Hi Andrew,

    I am sorry to inform you that will take me a bit more time, everything I try in order to allow those duplicates ends up in disaster :)

    Worst case scenario I will have to calculate the requirements on my own rather then replicating them, about 2-3 days of work I would estimate.

    Julius

  23. Hutuleac Iulius repo owner

    Hi Andrew,

    I published a new release, I ended up rewriting the whole requirement management. The explicit requirements are merged and never overwritten in jobs. The implicit task related requirements are no longer replicated but recalculated from scratch.

    This seems to be the only way to get a clean set of requirements, replication in this case is not possible.

    Best regards, Julius

  24. Andrew Nefedkin Account Deactivated

    Hi Julius.

    Sorry for delay.

    Now it seems to be all OK. At least nothing has been lost after replication.

    Thank you very much.

  25. Hutuleac Iulius repo owner

    No, thank you Andrew, your input is very appreciated.

    If you need any further assistance don't hesitate to contact.

    Julius

  26. Log in to comment