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(gitlabci): Use schema for dep extraction #33586

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

Conversation

zharinov
Copy link
Collaborator

Changes

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:

  • 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

@rarkins rarkins requested review from viceice and secustor January 14, 2025 13:03
@zharinov zharinov requested a review from viceice January 16, 2025 22:01
@rarkins rarkins enabled auto-merge January 17, 2025 06:13
lib/modules/manager/gitlabci/extract.ts Show resolved Hide resolved
Comment on lines +21 to +22
const docs = parseYaml(content, { uniqueKeys: false });
for (const dep of GitlabDocumentArray.parse(docs)) {
Copy link
Member

Choose a reason for hiding this comment

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

pass schema via customSchema option to parseYaml

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, its type inference doesn't work correctly. In order to fix it, I need first write schemas for all cases that pass generic unchecked type T to the parseSchema. Until then, customSchema is discouraged.

TLDR; if I do, the type of docs will be unknown[]

Copy link
Member

Choose a reason for hiding this comment

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

@zharinov zharinov requested a review from viceice January 22, 2025 18:44
viceice
viceice previously approved these changes Jan 31, 2025
@viceice
Copy link
Member

viceice commented Jan 31, 2025

ups, conflicted 🙃

# Conflicts:
#	lib/modules/manager/gitlabci/extract.spec.ts
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.

2 participants