•  
      story #21386 dry run REST project creation
    Summary
    Empty
    dry run REST project creation

    I know if there are know incompatibilitites before to go

    Proposal add ?dry_run option to POST /projects

    What should be checked:

    • User is allowed to create
    • Submitted categories selection and if some are required or not
    • Submitted project fields and if some are required or not
    • Shortname is valid
    • Full name is valid
    • Descriptions validity (short & long)

    ⚠️ The current code is not meant to ease the extraction of verification, the refactoring is a bit tricky.

    Limitations & security

    The validation is done in 2 "steps":

    • First we check if the user is allowed to create (permission, nb max project, etc)
    • Then, all other parameters are checked (in other word, it's not possible to assert if shortname is valid if the creator doesn't have the right to create projects).

    Error messages & L10N/I18N

    • In case of errors, error code is 400 and the route returns an array of errors with the language of the REST caller
    • When no errors, error code is 200 and body is empty

    Mandatory clean-up

    Before moving forward, we need to remove the SOAP project creation.

    Empty
    Empty
    Status
    Empty
    Done
    Development
    • [ ] Does it involves User Interface? 
    • [ ] Are there any mockups?
    • [ ] Are permissions checked?
    • [ ] Does it need Javascript development?
    • [ ] Does it need a forge upgrade bucket?
    • [ ] Does it need to execute things in system events?
    • [ ] Does it impact project creation (templates)?
    • [ ] Is it exploratory?
    Empty
    Details
    #21386
    Manuel Vacelet (vaceletm)
    2021-07-20 15:45
    2021-05-20 17:37
    3758

    References
    Referencing story #21386

    Artifact Tracker v5

    rel #20932 12.11

    Git commit

    tuleap/tuleap/stable

    [feature] Remove the project creation with SOAP 41e4af0d7f
    Remove unused code following removal of SOAP project creation e6af262280
    [feature] Create dry_run option for POST projects/ 2e62cf91a2
    [bug] Add missing exception catching 73e3bcf484
    Remove unused RestProjectCreator::$permission_checker 3e076c4a23
    [feature] Deal with project title/shortname/description errors abab5165c4
    [tech] Refactoring errors collectors in multiple objects 73a12ae5e9
    [tech] Project registration unit tests are checked by psalm 311cf2c1bb
    Verify in the dry-run phase if the user can choose the project visibility 4181341162
    Remove unused ProjectCreator::getProjectCreationData 8d804bf6d4
    Project visibility is verified in the project creation dry-run ac38320112
    [feature] Project categories are checked in dry/run fc95bb803a
    Remove unused property ProjectCreator::$default_project_visibility_retriever 0b817f95fe
    [tech] Introducing ProjectRegistrationSubmittedField* objets 4a2fdafbeb
    [tech] Inject arrays in exceptions e14cc57bbc
    [feature] collect project fields errors in dry_run f262c83cdb
    [doc] Add POST projects/ documentation 23bebb0cf5
    Cannot create a private project via the web UI on instances without restricted users 9296dcc760
    Include the validation of the template ID to the dry run phase 1aaaac1267
    [bug] Legacy old description project field must be checked only at XML import 70823df1e6
    [bug] Project import with CLI fails with mandatory categories 376bda950f
    [tech] Fix psalm error 45ea26229e

    Follow-ups

    User avatar
    • Acceptance criteria
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    • Status changed from On going to Done
    • Category set to
    User avatar
    Thomas Gerbet (tgerbet)2021-07-08 16:59

    Updating the acceptance criteria to drop the mention of the templates in the verification:

    • if a xml_template_name is provided it is always valid since that the only way to provide a valid representation (in the same way that you cannot an integer instead of a string and vice versa)
    • if template_id is used it heavily depends on the permissions the user has, therefore it is done preemptively with the rest of the permission checks

    • Acceptance criteria
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Acceptance criteria
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Acceptance criteria
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Acceptance criteria
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Acceptance criteria
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Acceptance criteria
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Acceptance criteria
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Acceptance criteria
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes