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

Use project ID for API calls if available #809

Merged
merged 10 commits into from
Jan 13, 2025
Merged

Conversation

fgreinacher
Copy link
Contributor

@fgreinacher fgreinacher commented Jan 12, 2025

This MR safely implements the suggestion from #580 (comment).

If CI_PROJECT_ID is available it will be used for accessing API resources. If it is not the previous logic to use CI_PROJECT_PATH will apply.

I'd suggest to review this commit-by-commit to be able to follow my train of thought.

Closes #543

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 14 changed files in this pull request and generated no comments.

Files not reviewed (8)
  • test/get-repo-id.test.js: Evaluated as low risk
  • test/publish.test.js: Evaluated as low risk
  • lib/success.js: Evaluated as low risk
  • lib/fail.js: Evaluated as low risk
  • lib/definitions/errors.js: Evaluated as low risk
  • lib/publish.js: Evaluated as low risk
  • test/integration.test.js: Evaluated as low risk
  • test/fail.test.js: Evaluated as low risk
@fgreinacher fgreinacher requested a review from Copilot January 12, 2025 15:59

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 13 changed files in this pull request and generated no comments.

Files not reviewed (8)
  • test/get-repo-id.test.js: Evaluated as low risk
  • lib/get-repo-id.js: Evaluated as low risk
  • test/publish.test.js: Evaluated as low risk
  • lib/success.js: Evaluated as low risk
  • lib/fail.js: Evaluated as low risk
  • lib/definitions/errors.js: Evaluated as low risk
  • test/integration.test.js: Evaluated as low risk
  • lib/publish.js: Evaluated as low risk
Comments suppressed due to low confidence (1)

test/get-project-context.test.js:6

getProjectContext({ env: {} }, "https://gitlbab.com", "https://api.gitlab.com", "https://gitlab.com/owner/repo.git")
@fgreinacher fgreinacher marked this pull request as ready for review January 12, 2025 16:19
@fgreinacher
Copy link
Contributor Author

@JonasSchubert Would you have a look at this? 🙇

@JonasSchubert
Copy link
Contributor

@JonasSchubert Would you have a look at this? 🙇

Sure @fgreinacher
Thanks for the implementation and the ping.

Copy link
Contributor

@JonasSchubert JonasSchubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fgreinacher I like the implementation a lot and also thanks for providing the commits as your train of thoughts. Helped a lot!

Beside one question regarding exposing a variable, and the pre-existing typo it looks good to me.

lib/get-project-context.js Outdated Show resolved Hide resolved
test/get-project-context.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@JonasSchubert JonasSchubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@JonasSchubert JonasSchubert merged commit 9d34d25 into master Jan 13, 2025
14 checks passed
@JonasSchubert JonasSchubert deleted the fix/project-id branch January 13, 2025 16:27
Copy link

🎉 This PR is included in version 13.2.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Use CI_PROJECT_ID instead of name of the project in API calls
2 participants