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

fix(changelog): gitRef check #15869

Merged
merged 12 commits into from
Jun 9, 2022

Conversation

atorrescogollo
Copy link
Contributor

@atorrescogollo atorrescogollo commented Jun 3, 2022

Changes

For some dependencies, (in my case kubernetes/autoscaler), they don't have a Changelog.md and the releases are mixed inside the repo:

...
https://github.com/kubernetes/autoscaler/releases/tag/cluster-autoscaler-chart-9.18.1
https://github.com/kubernetes/autoscaler/releases/tag/cluster-autoscaler-1.24.0
...

I'm using this datasource configuration:

datasource=github-releases depName=kubernetes/autoscaler extractVersion=^cluster-autoscaler-(?<version>[0-9\.]*)$

And I'm receiving this res variable when trying to get the Changelog:

// source-github.ts -> getChangeLogJSON
res = {
  project: {
    apiBaseUrl: 'https://api.github.com/',
    baseUrl: 'https://github.com/',
    type: 'github',
    repository: 'kubernetes/autoscaler',
    sourceUrl: 'https://github.com/kubernetes/autoscaler',
    sourceDirectory: undefined,
    depName: 'kubernetes/autoscaler'
  },
  versions: [
    {
      version: '1.24.0',
      gitRef: 'cluster-autoscaler-1.24.0',
      date: '2022-05-16T14:57:43.000Z',
      changes: [],
      compare: [Object]
    },
    ...
  ]
}

As you can see, version tag is different from gitRef and this comparison won't ever match for this use-case:

matchedRelease = releases.find(
      (r) => r.tag === version || r.tag === `v${version}`

We need to check also if matches the gitRef so that it can download the Changelog from releases notes.

Context

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 tick 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

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

please validate that it works for gitlab too

@rarkins rarkins changed the title Fix: GitRef check for Changelog fix(changelog): gitRef check Jun 3, 2022
@atorrescogollo
Copy link
Contributor Author

For some reason, #15653 along with this PR seems to break Release Notes message in the PR body:

@rarkins
Copy link
Collaborator

rarkins commented Jun 4, 2022

For some reason, #15653 along with this PR seems to break Release Notes message in the PR body:

That PR also refactored how tags are fetched for release notes. Please see if you can work out how to make the changes, otherwise @zharinov can help

@rarkins rarkins marked this pull request as draft June 4, 2022 07:39
@zharinov zharinov self-requested a review June 4, 2022 07:46
@zharinov
Copy link
Collaborator

zharinov commented Jun 4, 2022

For some reason, #15653 along with this PR seems to break Release Notes message

Found the reason, fix is ready

@atorrescogollo
Copy link
Contributor Author

Thanks, I think I found another way of doing this thing but also using config.extractVersion, which I think makes more sense. I will be publishing the change tomorrow for review

@atorrescogollo atorrescogollo marked this pull request as ready for review June 5, 2022 19:30
@atorrescogollo
Copy link
Contributor Author

Already rebased from main, fixed tests, added a new test for config.extractVersion and run tests locally

@viceice viceice enabled auto-merge (squash) June 9, 2022 11:35
@viceice
Copy link
Member

viceice commented Jun 9, 2022

CLA check hung 😞

@viceice viceice merged commit 0248f95 into renovatebot:main Jun 9, 2022
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 32.79.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2022
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.

None yet

5 participants