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

Add the option to specify the target project via project id #608

Open
tomerh2001 opened this issue Sep 29, 2023 · 6 comments
Open

Add the option to specify the target project via project id #608

tomerh2001 opened this issue Sep 29, 2023 · 6 comments
Labels

Comments

@tomerh2001
Copy link

My main repo is in bitbucket, and the CI/CD runs there in a bitbucket pipelines, but my client has it's own git repo which mirrors mine, and when I "release" a new version, I just push into their GitLab.

When semantic-release runs in my bitbucket pipeline, I am pushing to my client's GitLab using this custom plugin I wrote: https://github.com/tomerh2001/semantic-release-gitlab-merge-request, but then I also want to create a GitLab release right after

Their gitlab is hosted at a specific URL, and the target project has a different ID then the one the CI runs in, so it would be great if we could specify a target project ID (and possibly the branch from the target) for the release

@travi
Copy link
Member

travi commented Oct 1, 2023

i dont think i understand the request here. it sounds like your desired workflow is outside the normal expectation of what this gitlab plugin was designed for. since you have already built a plugin related to your workflow, i'm wondering why you wouldnt just handle the additional need you describe directly from within your custom plugin. could you help me understand what i am overlooking?

@tomerh2001
Copy link
Author

tomerh2001 commented Oct 1, 2023

Ideally for separation of concerns. I don't want my plugin to try to do too much, just a merge request, nothing else + while this plugin already exists and is 250+ star battle-tested.

I just need to be able to specify the target repo using the project ID, instead of having it try to infer the target based on the current repo, which for a plugin that aims to be the generic semantic-release Gitlab deployment doesn't sound too weird of a request

I.E. just an optional PROJECT_ID parameter

@fgreinacher
Copy link
Contributor

The workflow is indeed a bit special, but I think allowing to pass a project ID would be symmetrical to the existing possibility to pass a GITLAB_URL or GITLAB_PREFIX.

@JonasSchubert
Copy link
Contributor

The workflow is indeed a bit special, but I think allowing to pass a project ID would be symmetrical to the existing possibility to pass a GITLAB_URL or GITLAB_PREFIX.

Sounds like a valid option. The function get-repo-id couldbe adjusted and it could be allowed to provide a GITLAB_PROJECT_ID or similar

@tmeijn
Copy link

tmeijn commented Oct 20, 2023

The workflow is indeed a bit special, but I think allowing to pass a project ID would be symmetrical to the existing possibility to pass a GITLAB_URL or GITLAB_PREFIX.

Looking at the code @JonasSchubert referenced, wouldn't setting the env var CI_PROJECT_PATH solve this then? It seems to first try to infer from that variable and as a fallback the git url.

@fgreinacher
Copy link
Contributor

The workflow is indeed a bit special, but I think allowing to pass a project ID would be symmetrical to the existing possibility to pass a GITLAB_URL or GITLAB_PREFIX.

Looking at the code @JonasSchubert referenced, wouldn't setting the env var CI_PROJECT_PATH solve this then? It seems to first try to infer from that variable and as a fallback the git url.

Only partially, because it'll only be evaluated when running within GitLab CI (the service === "gitlab" condition).

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

No branches or pull requests

5 participants