-
Notifications
You must be signed in to change notification settings - Fork 46
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: report unsupported AutoYaST elements #1976
Open
imobachgs
wants to merge
28
commits into
master
Choose a base branch
from
profile-checker
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e21a294
refactor(ruby): split profile fetching and conversion
imobachgs 25d328a
feat(ruby): find unsupported elements in the AutoYaST profile
imobachgs 84915a2
feat(ruby): report AutoYaST unsupported elements
imobachgs 682381b
feat: extend the AutoYaST profile definition
imobachgs f8abcb6
feat(ruby): improve support level calculation
imobachgs a1e8ff3
feat(ruby): add network elements to AutoYaST compatibility
imobachgs bc0fbd4
fix(ruby): make RuboCop happy
imobachgs 1e8ecaf
chore(ruby): remove useless shebang lines
imobachgs 56fd289
fix(ruby): rake task to the top-level Rakefile
imobachgs d5ec2b6
fix(ruby): fix handling of unknown AutoYaST elements
imobachgs b621c12
feat(web): add an specific question to handle AutoYaST unsupported el…
imobachgs dcdab34
chore(ruby): drop ProfileFetcher#copy_files (unused)
imobachgs fb9039f
fix(ruby): do not read the profile if it was not fetched
imobachgs f33c81e
fix(ruby): use a slash (/) for AutoYaST element path separator
imobachgs 5b14f30
feat(web): improve UnsupportedAutoYaST component
imobachgs 2b110d6
chore(ruby): allow disabling the AutoYaST check
imobachgs 744c297
fix(ruby): fix ProfileFetcher documentation
imobachgs 9ee3b4a
docs: update changes files
imobachgs a9e9dd7
Merge branch 'master' into profile-checker
imobachgs 6795940
fix(ruby): fix location of commands.rb
imobachgs eb8ead1
fix(ruby): add unit tests for the AgamaAutoYaST command
imobachgs be389d4
fix(web): improve wording in the UnsupportedAutoYaST component
imobachgs e5519e6
docs: describe the autoyast.unsupported question
imobachgs 9044b34
autoyast compat: declare "bootproto" unsupported
mvidner 3fefbf5
Added JSON schema for autoyast-compat.json
mvidner 1086efc
feat(web): explain how to disable AutoYaST checks
imobachgs 6b4cfb1
fix(ruby): disable AutoYaST XML validation in agama-autoyast
imobachgs 35fa4dd
Merge branch 'master' into profile-checker
imobachgs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2024] SUSE LLC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2024] SUSE LLC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2024] SUSE LLC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2024] SUSE LLC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2024] SUSE LLC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2025] SUSE LLC | ||
# | ||
# All Rights Reserved. | ||
# | ||
# This program is free software; you can redistribute it and/or modify it | ||
# under the terms of version 2 of the GNU General Public License as published | ||
# by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, contact SUSE LLC. | ||
# | ||
# To contact SUSE LLC about this file by physical or electronic mail, you may | ||
# find current contact information at www.suse.com. | ||
|
||
require "agama/autoyast/profile_description" | ||
|
||
module Agama | ||
module AutoYaST | ||
# This class checks an AutoYaST profile and determines which unsupported elements are used. | ||
# | ||
# It does not report unknown elements. | ||
class ProfileChecker | ||
# Finds unsupported profile elements. | ||
# | ||
# @param profile [Yast::ProfileHash] AutoYaST profile to check | ||
# @return [Array<ProfileElement>] List of unsupported elements | ||
def find_unsupported(profile) | ||
description = ProfileDescription.load | ||
elements = elements_from(profile) | ||
|
||
elements.map do |e| | ||
normalized_key = e.gsub(/\[\d+\]/, "[]") | ||
element = description.find_element(normalized_key) | ||
element unless element&.supported? | ||
end.compact | ||
end | ||
|
||
private | ||
|
||
# Returns the elements from the profile | ||
# | ||
# @return [Array<String>] List of element IDs (e.g., "networking/backend") | ||
def elements_from(profile, parent = "") | ||
return [] unless profile.is_a?(Hash) | ||
|
||
profile.map do |k, v| | ||
current = parent.empty? ? k : "#{parent}#{ProfileDescription::SEPARATOR}#{k}" | ||
|
||
children = if v.is_a?(Array) | ||
v.map.with_index do |e, i| | ||
elements_from(e, "#{parent}#{ProfileDescription::SEPARATOR}#{k}[#{i}]") | ||
end | ||
else | ||
elements_from(v, k) | ||
end | ||
|
||
[current, *children] | ||
end.flatten | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what happens with unknown elements? Are they silently ignored now or does a different part of Agama report them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to ignore them by now and report only the status of the known elements. The idea is to extend the
compat
file to cover all the AutoYaST elements, stating whether it is unsupported, supported or planned.