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

feat(manager/composer): Use bitbucket-tags for vcs repos if it has bitbucket.org URL #24096

Merged
merged 10 commits into from
Sep 6, 2023

Conversation

BernhardK91
Copy link
Contributor

@BernhardK91 BernhardK91 commented Aug 26, 2023

Changes

Currently, all "vcs" repositories (repositories added via git URL instead of using a provider like packagist) use git-tags. Unfortunately, this is not working with Bitbucket and result in authentication issues.

This PR adds a regex-based check if it is a Bitbucket URL and declares to use the bitbucket-tags datasource. If it is not, the current behavior stays unchanged.

The credentials (if needed) are used from username and password if platform is set to "bitbucket". Otherwise, you can use hostRules to set the credentials f.e. as followed:

hostRules: [
        {
            matchType: "bitbucket-tags",
            matchHost: "bitbucket.org",
            username: process.env.RENOVATEBOT_USERNAME,
            password: process.env.RENOVATEBOT_PASSWORD,
        }
    ],

Context

Closes #24065.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

I have also tried with invalid credentials, and it failed as expected (to prove hostRules have an actual effect).

Note: This is my first PR at renovate, and I never worked with TypeScript before. So I am open for any suggestions or contributions to make this PR ready to merge if it is not already.

@CLAassistant
Copy link

CLAassistant commented Aug 26, 2023

CLA assistant check
All committers have signed the CLA.

lib/modules/manager/composer/schema.ts Outdated Show resolved Hide resolved
@BernhardK91 BernhardK91 requested a review from rarkins August 27, 2023 12:38
rarkins
rarkins previously approved these changes Aug 27, 2023
lib/modules/manager/composer/schema.ts Outdated Show resolved Hide resolved
@rarkins rarkins changed the title feat(manager/composer) Use bitbucket-tags for vcs repos if it has bitbucket.org URL (#24065) feat(manager/composer): Use bitbucket-tags for vcs repos if it has bitbucket.org URL (#24065) Aug 27, 2023
@BernhardK91 BernhardK91 changed the title feat(manager/composer): Use bitbucket-tags for vcs repos if it has bitbucket.org URL (#24065) feat(manager/composer): Use bitbucket-tags for vcs repos if it has bitbucket.org URL Aug 28, 2023
@BernhardK91 BernhardK91 requested a review from rarkins August 28, 2023 09:17
rarkins
rarkins previously approved these changes Aug 30, 2023
@rarkins rarkins enabled auto-merge August 30, 2023 12:57
@BernhardK91
Copy link
Contributor Author

Sorry for asking this question. Do I understand that right, that the PR gets merged as soon as it has tests that cover the new feature?

If so, I will try my best to contribute some. But I never worked with jest before. Perhaps anyone can guide me how I can check the coverage locally without running all the tests.

@rarkins
Copy link
Collaborator

rarkins commented Aug 31, 2023

Yes, it's set to automerge once tests pass, and that requires 100% unit test coverage

auto-merge was automatically disabled September 4, 2023 18:20

Head branch was pushed to by a user without write access

@BernhardK91
Copy link
Contributor Author

I have added a test, that should cover the change. Unfortunately, my commits disabled the auto-merge, so I cannot see if it really fixed the coverage.

As far as I can see locally, it should. At least it was on 100% when I ran jest /lib/modules/manager/composer/ --coverage --collectCoverageFrom=lib/modules/manager/composer/schema.ts after adding the new test.

@BernhardK91 BernhardK91 requested a review from rarkins September 4, 2023 18:30
@rarkins rarkins requested a review from viceice September 5, 2023 07:44
@rarkins rarkins added this pull request to the merge queue Sep 5, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2023
@BernhardK91
Copy link
Contributor Author

@rarkins Looks like Github had an issue what failed the Action. Can you requeue for merge? Thank you!

@rarkins rarkins added this pull request to the merge queue Sep 6, 2023
Merged via the queue into renovatebot:main with commit 2e57646 Sep 6, 2023
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 36.87.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@BernhardK91 BernhardK91 deleted the composer_bitbucket-tags branch September 6, 2023 13:41
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants