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

Automation and optimization work #5

Merged
merged 43 commits into from
Jan 11, 2025
Merged

Automation and optimization work #5

merged 43 commits into from
Jan 11, 2025

Conversation

sheepman4267
Copy link
Member

@sheepman4267 sheepman4267 commented Oct 29, 2024

This is the (long-awaited) appstream automation PR!

Here's what it does:

  • Adds an Ansible playbook which automates steps 1-5 of the current "Regenerating from teaparty server directly" workflow
  • Optimizes the creation of appstream metadata by symlinking every package to be analyzed into one directory. This script:

Here's what it doesn't include yet, which it needs to before this can be marked ready for review:

  • A Taskfile with further automation, including step 7 of the current instructions.
  • Updates to README.md documenting the new process.
  • A test plan in the description :)

Here's what it doesn't include, and I have no plans to:

  • I don't plan to replicate step 6 of the current instructions in this new workflow. I have thoughts on more automated testing, but 1: The playbook already checks that the generated metadata file's packages are all in the eopkg index, and 2: testing of the new appstream data should happen as part of the package update test plan anyway. IMO, testing it here makes it more likely that someone will become lax when testing the package update, which it probably where it's more likely to go wrong anyway.
  • Automation of the package update and PR process for appstream-data in the packages repo. On further reflection, I think any approach I can come up with there will be overly brittle and out of scope for this repo. That work will be done, but in a separate Taskfile in that package's files.

Test Plan
Follow the directions in the updated version of the README. That documentation is under test along with the actual process changes.

For reference, the current workflow is under the heading "Regenerating from teaparty server directly" in this repo's README.

@sheepman4267 sheepman4267 marked this pull request as ready for review November 21, 2024 21:14
Comment on lines 4 to 5
ansible_user: <your_user_on_teaparty>
# Set this to your username
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's better to recommend people to configure their username correctly in their SSH config so this file can be used as is?

For example:

Host *.getsol.us
  User <username here>

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, but I think it's out of scope here. I think this should be part of our staff onboarding processes, which should be written down (what people need access to, why, how to get there, etc.). If that exists, I've never seen it (at least, not in the "set up your SSH config correctly" level of detail). If we can get that documentation into shape in an appropriate place, I'd love to remove this hacky inventory creation script nonsense. I'm just not convinced that the correct place is here in this repo.

Feel free to convince me otherwise, though!

Copy link
Member

@silkeh silkeh Jan 9, 2025

Choose a reason for hiding this comment

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

I didn't mean to suggest to document that here, I just don't think that this project should carry the complexity burden of people not having configured their SSH correctly.

Edit: I've created an issue to document this https://github.com/getsolus/solus-team-docs/issues/60

archive_screenshots.sh Show resolved Hide resolved
@@ -0,0 +1,27 @@
#!/bin/python3
Copy link
Member

Choose a reason for hiding this comment

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

If we go the ~/.ssh/config route this should not be needed :S

create_symlinks.py Outdated Show resolved Hide resolved
create_symlinks.py Outdated Show resolved Hide resolved
create_symlinks.py Outdated Show resolved Hide resolved
create_symlinks.py Show resolved Hide resolved
Copy link

@TraceyC77 TraceyC77 left a comment

Choose a reason for hiding this comment

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

The README needs a step before generating mainstream data about copying hosts.yml.example to the real file and adding the username. Otherwise go-task full-process errors out. Once that's done this PR is good to go.

In my testing, once I set that up and ran go-task full-process, appstream data generation was successful

README.md Outdated
> Additionally, your GitHub account must have push access to this repository (should be true for all staff).
1. Ensure that your local clone of this repository is set up to be able to push (Cloning via GitHub CLI recommended).
2. Ensure you have `go-task` installed. All interaction with this tooling should be possible through the `Taskfile.yml` in this repository.
3. Run `go-task appstream-init`. This task will install `pyyaml` and `ansible` on your system, and then install the necessary ansible collection.

Choose a reason for hiding this comment

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

There needs to be a step here to copy and adapt inventory.yml.example and that the file needs to be named hosts.yml (due to the rule in .gitignore)

Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed the rule in .gitignore and made the inventory file generic. A username does not need to be listed there if your SSH is configured correctly, per the conversation with @silkeh.

Copy link

@TraceyC77 TraceyC77 left a comment

Choose a reason for hiding this comment

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

I re-tested after doing a hard reset on my local copy of the branch so I had the new generic hosts.yml. I already had an entry for teaparty in ~/.ssh.config.
Verified that appstream data was able to be kicked off an a commit with the data was created as expected.

I Silke's concerns have also been addressed.

Good to go!

Please clean up the git commit message and this can be squashed and merged

@sheepman4267 sheepman4267 merged commit 9f70d79 into master Jan 11, 2025
@sheepman4267 sheepman4267 deleted the ansible-playbook branch January 11, 2025 03:59
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.

4 participants