•  
      request #23383 Bad request error when planning a feature
    Infos
    #23383
    Joris MASSON (jmasson)
    2021-11-26 13:10
    2021-09-27 10:05
    24933
    Details
    Bad request error when planning a feature

    Given my Program is linked to at least one private Team project and given my current user is not member of that Team (and cannot see it) and given my user is member of a user group allowed to plan in Program Management
    when I try do drag/drop a feature from the top backlog to a program increment
    then I will get a 400 Bad Request saying there is an error during feature addition. On closer look, the underlying exception is that my user does not have permission to edit the artifact links field during an event that tries to plan user stories in the mirrored artifacts

    There should not be an error here, I should be forbidden to plan the feature because doing so will modify the mirrored program increments, and I cannot do that in the private Team project.

    Stacktrace

    #0 /usr/share/tuleap/plugins/tracker/include/Tracker/Artifact/Changeset/NewChangesetCreatorBase.class.php(140): Tracker_Artifact_Changeset_NewChangesetCreatorBase->validateNewChangeset()
    #1 /usr/share/tuleap/src/vendor/paragonie/easydb/src/EasyDB.php(1263): Tracker_Artifact_Changeset_NewChangesetCreatorBase->{closure}()
    #2 /usr/share/tuleap/src/common/DB/DBTransactionExecutorWithConnection.php(44): ParagonIE\EasyDB\EasyDB->tryFlatTransaction()
    #3 /usr/share/tuleap/plugins/tracker/include/Tracker/Artifact/Changeset/NewChangesetCreatorBase.class.php(219): Tuleap\DB\DBTransactionExecutorWithConnection->execute()
    #4 /usr/share/tuleap/plugins/tracker/include/Tracker/Artifact/Artifact.php(1210): Tracker_Artifact_Changeset_NewChangesetCreatorBase->create()
    #5 /usr/share/tuleap/plugins/program_management/include/Adapter/Program/Feature/UserStoriesInMirroredProgramIncrementsPlanner.php(114): Tuleap\Tracker\Artifact\Artifact->createNewChangeset()
    #6 /usr/share/tuleap/src/vendor/paragonie/easydb/src/EasyDB.php(1263): Tuleap\ProgramManagement\Adapter\Program\Feature\UserStoriesInMirroredProgramIncrementsPlanner->Tuleap\ProgramManagement\Adapter\Program\Feature\{closure}()
    #7 /usr/share/tuleap/src/common/DB/DBTransactionExecutorWithConnection.php(44): ParagonIE\EasyDB\EasyDB->tryFlatTransaction()
    #8 /usr/share/tuleap/plugins/program_management/include/Adapter/Program/Feature/UserStoriesInMirroredProgramIncrementsPlanner.php(124): Tuleap\DB\DBTransactionExecutorWithConnection->execute()
    #9 /usr/share/tuleap/plugins/program_management/include/Domain/Program/Backlog/ArtifactUpdatedHandler.php(63): Tuleap\ProgramManagement\Adapter\Program\Feature\UserStoriesInMirroredProgramIncrementsPlanner->plan()
    #10 /usr/share/tuleap/plugins/program_management/include/Domain/Program/Backlog/ArtifactUpdatedHandler.php(50): Tuleap\ProgramManagement\Domain\Program\Backlog\ArtifactUpdatedHandler->planArtifactIfNeeded()
    #11 /usr/share/tuleap/plugins/program_management/include/program_managementPlugin.php(793): Tuleap\ProgramManagement\Domain\Program\Backlog\ArtifactUpdatedHandler->handle()
    #12 /usr/share/tuleap/src/common/Event/EventManager.class.php(127): program_managementPlugin->trackerArtifactUpdated()
    #13 /usr/share/tuleap/src/common/Plugin/PluginLoader.php(72): EventManager->eventManagerDispatch()
    #14 /usr/share/tuleap/src/common/Event/EventManager.class.php(116): Tuleap\Plugin\PluginLoader->Tuleap\Plugin\{closure}()
    #15 /usr/share/tuleap/src/common/Event/EventManager.class.php(146): EventManager->processEventOnListener()
    #16 /usr/share/tuleap/src/common/Event/EventManager.class.php(98): EventManager->dispatch()
    #17 /usr/share/tuleap/plugins/tracker/include/Tracker/Artifact/Changeset/NewChangesetCreatorBase.class.php(229): EventManager->processEvent()
    #18 /usr/share/tuleap/plugins/tracker/include/Tracker/Artifact/Artifact.php(1210): Tracker_Artifact_Changeset_NewChangesetCreatorBase->create()
    #19 /usr/share/tuleap/plugins/tracker/include/Tracker/FormElement/Field/ArtifactLink/ArtifactLinkUpdater.php(146): Tuleap\Tracker\Artifact\Artifact->createNewChangeset()
    #20 /usr/share/tuleap/plugins/program_management/include/Adapter/Program/Backlog/ProgramIncrement/Content/FeatureAdditionProcessor.php(63): Tuleap\Tracker\FormElement\Field\ArtifactLink\ArtifactLinkUpdater->updateArtifactLinks()
    #21 /usr/share/tuleap/plugins/program_management/include/Domain/Program/Backlog/ProgramIncrement/Content/FeaturePlanner.php(85): Tuleap\ProgramManagement\Adapter\Program\Backlog\ProgramIncrement\Content\FeatureAdditionProcessor->add()
    #22 /usr/share/tuleap/src/vendor/paragonie/easydb/src/EasyDB.php(1263): Tuleap\ProgramManagement\Domain\Program\Backlog\ProgramIncrement\Content\FeaturePlanner->Tuleap\ProgramManagement\Domain\Program\Backlog\ProgramIncrement\Content\{closure}()
    #23 /usr/share/tuleap/src/common/DB/DBTransactionExecutorWithConnection.php(44): ParagonIE\EasyDB\EasyDB->tryFlatTransaction()
    #24 /usr/share/tuleap/plugins/program_management/include/Domain/Program/Backlog/ProgramIncrement/Content/FeaturePlanner.php(86): Tuleap\DB\DBTransactionExecutorWithConnection->execute()
    #25 /usr/share/tuleap/plugins/program_management/include/Domain/Program/Backlog/ProgramIncrement/Content/ContentModifier.php(126): Tuleap\ProgramManagement\Domain\Program\Backlog\ProgramIncrement\Content\FeaturePlanner->plan()
    #26 /usr/share/tuleap/plugins/program_management/include/Domain/Program/Backlog/ProgramIncrement/Content/ContentModifier.php(91): Tuleap\ProgramManagement\Domain\Program\Backlog\ProgramIncrement\Content\ContentModifier->planFeature()
    #27 /usr/share/tuleap/plugins/program_management/include/REST/v1/ProgramIncrementResource.php(238): Tuleap\ProgramManagement\Domain\Program\Backlog\ProgramIncrement\Content\ContentModifier->modifyContent()
    #28 [internal function]: Tuleap\ProgramManagement\REST\v1\ProgramIncrementResource->patchContent()
    #29 /usr/share/tuleap/src/vendor/luracast/restler/vendor/Luracast/Restler/Restler.php(1065): call_user_func_array()
    #30 /usr/share/tuleap/src/vendor/luracast/restler/vendor/Luracast/Restler/Restler.php(304): Luracast\Restler\Restler->call()
    #31 /usr/share/tuleap/src/www/api/index.php(91): Luracast\Restler\Restler->handle()
    #32 {main}
    
    Program Management
    13.0
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Marie Ange Garnier (marieange)
    Closed
    2021-11-26
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Joris MASSON (jmasson)2021-11-26 13:10
    • Status changed from Waiting for information to Closed
    • Connected artifacts
    • Close date set to 2021-11-26
    User avatar
    Joris MASSON (jmasson)2021-10-11 11:33

    There are still some cases where it can appear: if my user is project admin of the Program project but is not member of one of the Teams. In that case, I am allowed to plan but it will result in Bad Request error