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

docs(azure): update azuredevops docs to match new changes #33788

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mathisgauthey
Copy link
Contributor

@mathisgauthey mathisgauthey commented Jan 23, 2025

Changes

I wanted to add examples so that new users will benefit from the recent changes related to how renovate picks up tasks version using internal APIs when azure-pipelines is enabled in renovate configuration.

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 select one)

I have verified these changes via:

  • Using pnpm docs:build and pnpm mkdocs serve to preview the documentation changes.

Why another PR ?

I made a mistake with my previous PR by committing with the wrong mail, hence the CLA validation did not seem to work fine.
Sorry for the inconvenience.

@mathisgauthey mathisgauthey changed the title Update azuredevops docs docs(azure): update azuredevops docs to match new changes Jan 23, 2025
{
"platform": "azure",
"endpoint": "https://dev.azure.com/ORG_NAME",
"token": "process.env.RENOVATE_TOKEN",
Copy link
Collaborator

Choose a reason for hiding this comment

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

JSON files cannot read from process.env. This example would put the literal string value "process.env.RENOVATE_TOKEN" into the file, and not the value from env. Same as for the hostRules below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @rarkins , it works on our on-prem azuredevops server.

Would it then works just because I'm calling npx renovate with these env vars ?

  RENOVATE_PLATFORM: azure
  RENOVATE_ENDPOINT: $(System.CollectionUri)
  RENOVATE_CONFIG_FILE: $(Build.SourcesDirectory)/renovate_bot_config.json
  RENOVATE_TOKEN: $(System.AccessToken)
  LOG_LEVEL: debug

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably. If you define things like token in both file and env, env wins. So the "wrong" value for token above would be overridden by the RENOVATE_TOKEN env

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated it.

- bash: |
add-apt-repository ppa:git-core/ppa
apt update && apt install git -y
displayName: 'Install latest git version'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
displayName: 'Install latest git version'
displayName: 'Install latest version of Git'

Are you allowed to use capitalization in the displayName field/variable?


<!-- prettier-ignore -->
!!! info
Renovate bot is now using the set of APIs that azure provides to query the azure-pipelines tasks versions directly from the instance. ([PR #32966](https://github.com/renovatebot/renovate/pull/32966) and [Discussion #24820](https://github.com/renovatebot/renovate/discussions/24820))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Renovate bot is now using the set of APIs that azure provides to query the azure-pipelines tasks versions directly from the instance. ([PR #32966](https://github.com/renovatebot/renovate/pull/32966) and [Discussion #24820](https://github.com/renovatebot/renovate/discussions/24820))
Renovate now uses the set of APIs that Azure provides to query the azure-pipelines tasks versions directly from the instance. Read [pull request #32966](https://github.com/renovatebot/renovate/pull/32966) and [discussion #24820](https://github.com/renovatebot/renovate/discussions/24820) for more background information on this change.

!!! info
Renovate bot is now using the set of APIs that azure provides to query the azure-pipelines tasks versions directly from the instance. ([PR #32966](https://github.com/renovatebot/renovate/pull/32966) and [Discussion #24820](https://github.com/renovatebot/renovate/discussions/24820))

To use it, you need to have in your config :
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
To use it, you need to have in your config :
To let Renovate use the Azure DevOps internal API, you must set these variables in your config:

To use it, you need to have in your config :

- `platform` = `azure`
- `endpoint` = `$(System.CollectionUri)` (an [azure predefined variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- `endpoint` = `$(System.CollectionUri)` (an [azure predefined variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml))
- `endpoint` = `$(System.CollectionUri)`, this is an [Azure predefined variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml)

Comment on lines +113 to +114
An example configuration file, in `.json` format this time, would be :

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
An example configuration file, in `.json` format this time, would be :

Let's use a codeblock title instead of this line. 😉

Material for MkDocs, adding a title to a codeblock


An example configuration file, in `.json` format this time, would be :

```json
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
```json
```json title="Example config file in JSON format"

"packageRules": [
{
"matchDatasources": ["azure-pipelines-tasks"],
"extractVersion": "^(?<version>\\d+)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the reason for this? Are there some characters after which need ignoring?

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

Successfully merging this pull request may close these issues.

3 participants