8000 Services-manager conversion to scripts by mchf · Pull Request #2319 · agama-project/agama · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Services-manager conversion to scripts #2319

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

Merged
merged 15 commits into from
May 19, 2025
Merged

Conversation

mchf
Copy link
Contributor
@mchf mchf commented May 3, 2025

Problem

Missing support for `AY profile <services-manager> section .

Solution

Another piece to AutoYaST profile conversion. Takes <services-manager> section and turns it into agama's post install script(s)

Testing

  • TBD: Tested manually

Remember to look at it from the user's perspective. Yes you have made the compiler happy.
But will the humans even know about your contribution? Sometimes they cannot miss it,
other times they need advertisement and explanation.

Look for relevant sections and adjust:

@mchf mchf force-pushed the ay-services-manager-conversion branch 3 times, most recently from a6cf0cf to 941f7fc Compare May 3, 2025 19:16
@mchf mchf force-pushed the ay-services-manager-conversion branch from 941f7fc to ada02f0 Compare May 3, 2025 19:20
@mchf mchf force-pushed the ay-services-manager-conversion branch 7 times, most recently from f76ee03 to 01f56c1 Compare May 6, 2025 18:55
@mchf mchf force-pushed the ay-services-manager-conversion branch 2 times, most recently from ff16345 to ab14d92 Compare May 7, 2025 08:29
@mchf mchf force-pushed the ay-services-manager-conversion branch from ab14d92 to 5f99187 Compare May 7, 2025 08:36
Copy link
Contributor
@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

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

You need to adjust the approach a bit. Please, check the comments. Thanks!

def ondemand_to_cmd
ondemand_services.map do |service|
"systemctl enable #{service}.socket"
end.join("\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Bear in mind that JSON does not allow multi-line strings. You might need to escape the "" (not tested).

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 thought that json doesn't work with:

body: "first line
second line"

but

body: "first line\nsecondline" should be fine

but you're right i need to double check whether i really produce the second case

@mchf mchf force-pushed the ay-services-manager-conversion branch from 4981419 to de011ec Compare May 7, 2025 18:47
@mchf mchf requested a review from imobachgs May 9, 2025 08:18
@mchf mchf force-pushed the ay-services-manager-conversion branch from 654c09e to 4e0e6b3 Compare May 9, 2025 08:22
Copy link
Contributor
@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

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

Please, update https://github.com/agama-project/agama/blob/master/service/share/autoyast-compat.json#L288-L289.

Generating four different scripts looks too much to me. Why not combine all of them into a single script? You would not need to worry about indexes and that stuff.

@@ -85,6 +86,8 @@ def read_post_scripts
scripts = scripts_section.fetch("chroot-scripts", []).map do |script|
read_post_script(script)
end
scripts += ServicesManagerReader.new(profile).read
Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to change the array in place, you might want to use concat. But I do not have a strong opinion.

@mchf
Copy link
Contributor Author
mchf commented May 9, 2025

Generating four different scripts looks too much to me. Why not combine all of them into a single script? You would not need to worry about indexes and that stuff.

The main idea was that in theory we might decide to generate a slightly different scripts for various services types in the future. So, just "logical" separation.

@imobachgs
Copy link
Contributor

The main idea was that in theory we might decide to generate a slightly different scripts for various services types in the future. So, just "logical" separation.

I think it adds some complexity to the implementation and, more important, to the resulting profile with no benefits. We can split the script in the future if needed.

@mchf mchf requested a review from imobachgs May 15, 2025 07:40
Copy link
Contributor
@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@mchf mchf force-pushed the ay-services-manager-conversion branch from e4f2efd to 9c548ec Compare May 15, 2025 08:03
@coveralls
Copy link
coveralls commented May 15, 2025

Coverage Status

coverage: 88.891% (+0.02%) from 88.869%
when pulling 31adafb on ay-services-manager-conversion
into 26b4696 on master.

@mchf mchf force-pushed the ay-services-manager-conversion branch from 877106e to 51c49ae Compare May 15, 2025 13:36
@mchf mchf force-pushed the ay-services-manager-conversion branch from aa4192e to 31adafb Compare May 19, 2025 06:06
@mchf mchf merged commit 00ac137 into master May 19, 2025
10 checks passed
@mchf mchf deleted the ay-services-manager-conversion branch May 19, 2025 06:13
@imobachgs imobachgs mentioned this pull request May 26, 2025
imobachgs added a commit that referenced this pull request May 26, 2025
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
0