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

refactor(managers): yaml schema checks #26811

Merged
merged 9 commits into from Feb 25, 2024

Conversation

secustor
Copy link
Collaborator

Changes

add yaml schema checks for some managers. This can be considered batch 1

Context

I have tried to keep changes to a minimum and have only removed/reworked logic where it has been obvious that it can not be reached anymore.

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

@secustor secustor requested a review from viceice January 22, 2024 21:35
@secustor secustor changed the title refactor(managers) yaml schema checks refactor(managers): yaml schema checks Jan 22, 2024
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.

first part

lib/modules/manager/docker-compose/schema.ts Show resolved Hide resolved
lib/modules/manager/fleet/types.ts Outdated Show resolved Hide resolved
lib/modules/manager/flux/schema.ts Show resolved Hide resolved
lib/modules/manager/flux/schema.ts Outdated Show resolved Hide resolved
lib/modules/manager/flux/schema.ts Show resolved Hide resolved
@secustor secustor requested a review from viceice January 26, 2024 17:43
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.

otherwise LGTM

@rarkins rarkins added this pull request to the merge queue Feb 25, 2024
Merged via the queue into renovatebot:main with commit 14cba69 Feb 25, 2024
35 checks passed
@secustor secustor deleted the refactor/add-yaml-schema-checks branch February 25, 2024 07:57
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 37.213.1 🎉

The release is available on:

Your semantic-release bot 📦🚀


const DockerComposeService = z.object({
image: z.string().optional(),
build: z
Copy link
Contributor

Choose a reason for hiding this comment

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

@secustor build does not need to be an object in the compose spec, it may be, and often is, a string.

https://docs.docker.com/compose/compose-file/compose-file-v2/#build

This has broken a bunch of our compose files that use the shorthand build: ./path and compose files can no longer be parsed.

klutchell added a commit to klutchell/renovate that referenced this pull request Feb 27, 2024
klutchell added a commit to klutchell/renovate that referenced this pull request Feb 27, 2024
klutchell added a commit to klutchell/renovate that referenced this pull request Feb 27, 2024
@viceice viceice added the regression Issue about a regression bug, or the PR caused it label Feb 27, 2024
@sherif-fanous
Copy link

sherif-fanous commented Feb 28, 2024

@secustor This PR has broken Argo-CD for me. I keep getting these errors now

       "error": {
         "message": "Schema error",
         "stack": "ZodError: Schema error\n    at Object.get error [as error] (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/node_modules/zod/lib/types.js:43:31)\n    at parseYaml (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/util/yaml.ts:53:23)\n    at Object.extractPackageFile (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/modules/manager/argocd/extract.ts:36:28)\n    at extractPackageFile (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/modules/manager/index.ts:75:9)\n    at getManagerPackageFiles (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/workers/repository/extract/manager-files.ts:45:43)\n    at /opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/workers/repository/extract/index.ts:57:28\n    at async Promise.all (index 0)\n    at extractAllDependencies (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/workers/repository/extract/index.ts:54:26)\n    at extract (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/workers/repository/process/extract-update.ts:140:28)\n    at extractDependencies (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/workers/repository/process/index.ts:154:26)\n    at Object.renovateRepository (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/workers/repository/index.ts:63:9)\n    at attributes.repository (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/workers/global/index.ts:200:11)\n    at start (/opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/workers/global/index.ts:185:7)\n    at /opt/homebrew/Cellar/renovate/37.218.0/libexec/lib/node_modules/renovate/lib/renovate.ts:18:22",
         "issues": {
           "kind": "Invalid literal value, expected \"ApplicationSet\"",
           "spec": {
             "sources": {"1": {"targetRevision": "Required"}},
             "template": "Required"
           }
         }
       },

All my Argo CD manifest are Applications so I'm not even sure why it's complaining about ApplicationSet. I don't use these at all.

Have currently reverted back to 37.212.0 and everything is working

I don't seem to be able to open an issue in this repo so am just posting in the PR hoping this will be seen.

Thanks

@rarkins
Copy link
Collaborator

rarkins commented Feb 28, 2024

@sherif-fanous please create a discussion under category "Report a problem" and include either a reproduction or sufficient logs/description

@sherif-fanous
Copy link

@rarkins #27617

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Issue about a regression bug, or the PR caused it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants