Files
backstage/.changeset/grumpy-clouds-drum.md
T
Borchies 5921b5ce49 chore(gitlab-mr-action): remove deprecation of projectid for template action
* `projectid` is now passed through the query parameter `project` in the `repoUrl`. It still allows people to not use
  the `projectid` and use the `repoUrl` with the `owner` and `repo` query parameters instead. This makes it easier
  to publish to repositories instead of writing the full path to the project.
* Changed the `parseUrl` function so it uses a `switch-case` statement which makes the function more readable
  than having several `if-else` statements.
* Created an auxiliary function called `checkRequiredParams`. The function checks if the required parameters
  (given as arguments) are present in the URL.
* The function `parseUrl` uses `checkRequiredParams` to verify that all the required query parameters are present
  in the repo's URL. This replaces the `if-else` mess with a `switch` statement for better readability.
* asserted the type of the constant `repo` to be a string to fix the following error:
  TS2322 (`Type 'string | null' is not assignable to type 'string'`)
* added unit tests in `util.test.ts` for `parseRepoUrl` function

Signed-off-by: Borchies <borja.gonzalez@sinch.com>
2022-10-24 09:22:41 +02:00

418 B

@backstage/plugin-scaffolder-backend
@backstage/plugin-scaffolder-backend
minor
  • The GitLab Project ID for the publish:gitlab:merge-request action is now passed through the query parameter project in the repoUrl. It still allows people to not use the projectid and use the repoUrl with the owner and repo query parameters instead. This makes it easier to publish to repositories instead of writing the full path to the project.