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: renovate handle regexManagers to update conftest/tf versions #2807

Merged
merged 6 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
# We do this instead of setting --default-tf-version because setting
nitrocode marked this conversation as resolved.
Show resolved Hide resolved
# that flag starts the download asynchronously so we'd have a race
# condition.
# renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp
TERRAFORM_VERSION: 1.3.6
steps:
- checkout
Expand Down
37 changes: 0 additions & 37 deletions .github/dependabot.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
extends: [
"config:base",
"schedule:earlyMondays"
],
automerge: false,
platformAutomerge: false,
labels: ["dependencies"],
postUpdateOptions: ["gomodTidy", "yarnDedupeHighest"],
prHourlyLimit: 0,
prConcurrentLimit: 5,
packageRules: [
// e2e test depends on testing/Dockefile testing-image which has conftest specific version.
// to upgrade conftest versions, we need following PRs.
// 1. update testing/Dockerfile conftest version
// 2. update testing-env tag
// 3. update e2e conftest version
// this settings allow to create only testing/Dockefile contest version update PR which uses branch prefix.
{
matchPaths: ["testing/**"],
matchPackagePatterns: ["conftest"],
additionalBranchPrefix: "{{baseDir}}-",
groupName: "conftest-testing",
prBodyNotes: [
":warning: You need to upgrade testing-env conftest firstly, then upgrade other conftest versions for e2e :warning:",
],
},
{
ignorePaths: ["testing/**"],
matchPackagePatterns: ["github-actions"],
groupName: "github-",
},
{
// we need to upgrade testing-env on ci quickly
matchPaths: [".github/**"],
matchPackageNames: ["ghcr.io/runatlantis/testing-env"],
groupName: "testing-env-ci-test",
schedule: ["every 1 hour after 00:00 and before 23:59 every day"],
},
],
// https://docs.renovatebot.com/modules/manager/regex/
regexManagers: [
{
fileMatch: ["(^|/)Dockerfile$", "(^|/)Dockerfile\\.[^/]*$"],
matchStrings: [
// example:
// renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp
// ENV DEFAULT_TERRAFORM_VERSION=x.x.x
"renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\sENV .*?_VERSION=(?<currentValue>.*)\\s",
],
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
extractVersionTemplate: '^v(?<version>\\d+\\.\\d+\\.\\d+)',
},
{
fileMatch: [".*go$"],
matchStrings: [
// example:
// const ConftestVersion = "x.x.x" // renovate: datasource=github-releases depName=open-policy-agent/conftest
"\\sconst .*Version = \"(?<currentValue>.*)\"\\s// renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s",
],
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
extractVersionTemplate: '^v(?<version>\\d+\\.\\d+\\.\\d+)',
},
{
fileMatch: [".circleci/config.yml$"],
matchStrings: [
// example:
// # renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp
// TRRAFORM_VERSION: x.x.x
"renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.*?_VERSION: (?<currentValue>.*)\\s",
],
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
extractVersionTemplate: '^v(?<version>\\d+\\.\\d+\\.\\d+)',
},
]
}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ FROM ${ATLANTIS_BASE}:${ATLANTIS_BASE_TAG_DATE}-${ATLANTIS_BASE_TAG_TYPE} AS bas
ARG TARGETPLATFORM

# install terraform binaries
# renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp
ENV DEFAULT_TERRAFORM_VERSION=1.3.6

# In the official Atlantis image we only have the latest of each Terraform version.
Expand All @@ -43,6 +44,7 @@ RUN AVAILABLE_TERRAFORM_VERSIONS="1.0.11 1.1.9 1.2.9 ${DEFAULT_TERRAFORM_VERSION
done && \
ln -s "/usr/local/bin/tf/versions/${DEFAULT_TERRAFORM_VERSION}/terraform" /usr/local/bin/terraform

# renovate: datasource=github-releases depName=open-policy-agent/conftest
ENV DEFAULT_CONFTEST_VERSION=0.35.0

RUN AVAILABLE_CONFTEST_VERSIONS="${DEFAULT_CONFTEST_VERSION}" && \
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/runatlantis/atlantis:latest
COPY atlantis /usr/local/bin/atlantis
# TODO: remove this once we get this in the base image
# renovate: datasource=github-releases depName=open-policy-agent/conftest
ENV DEFAULT_CONFTEST_VERSION=0.35.0

WORKDIR /atlantis/src
2 changes: 1 addition & 1 deletion server/controllers/events/events_controller_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
. "github.com/runatlantis/atlantis/testing"
)

const ConftestVersion = "0.35.0"
const ConftestVersion = "0.35.0" // renovate: datasource=github-releases depName=open-policy-agent/conftest
nitrocode marked this conversation as resolved.
Show resolved Hide resolved

var applyLocker locking.ApplyLocker
var userConfig server.UserConfig
Expand Down
2 changes: 1 addition & 1 deletion testdrive/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
)

const hashicorpReleasesURL = "https://releases.hashicorp.com"
const terraformVersion = "1.3.6"
const terraformVersion = "1.3.6" // renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to change 1.3.5 to 1.3.6? It's not changed in the other places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, runatlantis:renovate/configure branch contains 1.3.5, and main branch contains 1.3.6.

So could you update #2681?

Copy link
Member

Choose a reason for hiding this comment

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

Not sure what I'm updating in that pr ? Once this PR is merged, it will close #2681

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#2681 PR is renovate introduce confirmation PR.

So it is better to do followings.

  1. merge this feat: renovate handle regexManagers to update conftest/tf versions #2807 into Configure Renovate - abandoned #2681
  2. confirm renovate config is all valid on Configure Renovate - abandoned #2681 PR description which will be updated by renovate
  3. merge Configure Renovate - abandoned #2681 into main

Copy link
Contributor Author

Choose a reason for hiding this comment

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

or not need it, I will change this PR base branch to main.

const ngrokDownloadURL = "https://bin.equinox.io/c/4VmDzA7iaHb"
const ngrokAPIURL = "localhost:41414" // We hope this isn't used.
const atlantisPort = 4141
Expand Down
2 changes: 2 additions & 0 deletions testing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN apt-get update && apt-get --no-install-recommends -y install unzip \
&& rm -rf /var/lib/apt/lists/*

# Install Terraform
# renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp
ENV TERRAFORM_VERSION=1.3.6
RUN case $(uname -m) in x86_64|amd64) ARCH="amd64" ;; aarch64|arm64|armv7l) ARCH="arm64" ;; esac && \
wget -nv -O terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${ARCH}.zip && \
Expand All @@ -14,6 +15,7 @@ RUN case $(uname -m) in x86_64|amd64) ARCH="amd64" ;; aarch64|arm64|armv7l) ARCH
rm terraform.zip

# Install conftest
# renovate: datasource=github-releases depName=open-policy-agent/conftest
ENV CONFTEST_VERSION=0.35.0
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN case $(uname -m) in x86_64|amd64) ARCH="x86_64" ;; aarch64|arm64|armv7l) ARCH="arm64" ;; esac && \
Expand Down