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

Configure AppStreams via Activation Keys #8909

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

wweellddeerr
Copy link
Contributor

@wweellddeerr wweellddeerr commented Jun 11, 2024

What does this PR change?

Add a new tab in activation key details page to pick AppStreams and enable the selected AppStreams on systems bootstrap.

GUI diff

Before:

image

After:

image

image

  • DONE

Documentation

Test coverage

  • No tests: add explanation

  • No tests: already covered

  • Unit tests were added

  • Cucumber tests were added

  • DONE

Links

Issue(s): https://github.com/SUSE/spacewalk/issues/24198

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "javascript_lint"
  • Re-run test "spacecmd_unittests"

Before you merge

Check How to branch and merge properly!

Copy link
Contributor

👋 Hello! Thanks for contributing to our project.
Acceptance tests will take some time (aprox. 1h), please be patient ☕
You can see the progress at the end of this page and at https://github.com/uyuni-project/uyuni/pull/8909/checks
Once tests finish, if they fail, you can check 👀 the cucumber report. See the link at the output of the action.
You can also check the artifacts section, which contains the logs at https://github.com/uyuni-project/uyuni/pull/8909/checks.

If you are unsure the failing tests are related to your code, you can check the "reference jobs". These are jobs that run on a scheduled time with code from master. If they fail for the same reason as your build, it means the tests or the infrastructure are broken. If they do not fail, but yours do, it means it is related to your code.

Reference tests:

KNOWN ISSUES

Sometimes the build can fail when pulling new jar files from download.opensuse.org . This is a known limitation. Given this happens rarely, when it does, all you need to do is rerun the test. Sorry for the inconvenience.

For more tips on troubleshooting, see the troubleshooting guide.

Happy hacking!
⚠️ You should not merge if acceptance tests fail to pass. ⚠️

Copy link
Contributor

github-actions bot commented Jun 11, 2024

Suggested tests to cover this Pull Request
  • proxy_cobbler_pxeboot
  • srv_monitoring
  • srv_rename_hostname
  • proxy_branch_network
  • allcli_sanity
  • minssh_bootstrap_api
  • srv_channels_add
  • min_rhlike_monitoring
  • min_deblike_remote_command
  • srv_power_management
  • srv_power_management_api
  • srv_logfile
  • min_action_chain
  • min_project_lotus
  • minssh_move_from_and_to_proxy
  • min_deblike_openscap_audit
  • proxy_retail_pxeboot_and_mass_import
  • srv_check_sync_source_packages
  • min_salt_minions_page
  • allcli_overview_systems_details
  • min_bootstrap_reactivation
  • allcli_config_channel
  • minkvm_guests
  • min_salt_formulas
  • srv_sync_products
  • min_ansible_control_node
  • srv_patches_page
  • min_salt_formulas_advanced
  • srv_payg_ssh_connection
  • srv_handle_software_channels_with_ISS_v2
  • srv_docker
  • proxy_register_as_minion_with_script
  • srv_datepicker
  • min_salt_openscap_audit
  • minssh_ansible_control_node
  • min_salt_install_package
  • srv_user_configuration_salt_states
  • allcli_system_group
  • srv_group_union_intersection
  • min_check_patches_install
  • srv_change_password
  • srv_users
  • allcli_action_chain
  • srv_power_management_redfish
  • srv_user_preferences
  • min_recurring_action
  • min_monitoring
  • srv_dist_channel_mapping
  • min_salt_pkgset_beacon
  • minssh_salt_install_package
  • buildhost_osimage_build_image
  • srv_check_channels_page
  • srv_disable_local_repos_off
  • min_activationkey
  • min_deblike_ssh
  • srv_clone_channel_npn
  • min_salt_user_states
  • srv_virtual_host_manager
  • srv_manage_activationkey
  • allcli_reboot
  • srv_notifications
  • min_config_state_channel_subscriptions
  • min_custom_pkg_download_endpoint
  • sle_minion
  • sle_ssh_minion
  • srv_reportdb
  • min_rhlike_ssh
  • srv_docker_advanced_content_management
  • srv_change_task_schedule
  • min_virthost
  • srv_mainpage
  • min_rhlike_remote_command
  • min_salt_minion_details
  • srv_salt_download_endpoint
  • srv_check_reposync
  • srv_wait_for_reposync
  • min_salt_software_states
  • min_salt_migration
  • min_cve_audit
  • srv_activationkey_api
  • min_config_state_channel
  • min_deblike_monitoring
  • srv_content_lifecycle
  • srv_cobbler_sync
  • srv_manage_channels_page
  • srv_create_activationkey
  • min_rhlike_salt_install_package_and_patch
  • min_move_from_and_to_proxy
  • srv_organization_credentials
  • srv_first_settings
  • srv_cobbler_distro
  • srv_push_package
  • buildhost_docker_auth_registry
  • min_bootstrap_ssh_key
  • srv_add_rocky8_repositories
  • min_bootstrap_api
  • srv_channel_api
  • min_salt_mgrcompat_state
  • min_timezone
  • srv_delete_channel_from_ui
  • srv_salt
  • min_rhlike_openscap_audit
  • min_deblike_salt
  • buildhost_docker_build_image
  • srv_docker_cve_audit
  • allcli_software_channels_dependencies
  • srv_cobbler_buildiso
  • min_empty_system_profiles
  • min_deblike_salt_install_package
  • srv_custom_system_info
  • min_retracted_patches
  • min_bootstrap_script
  • proxy_as_pod_basic_tests
  • allcli_update_activationkeys
  • min_deblike_salt_install_with_staging
  • min_ssh_tunnel
  • srv_handle_config_channels_with_ISS_v2
  • srv_delete_channel_with_tool
  • min_docker_api
  • srv_distro_cobbler
  • srv_cobbler_profile
  • srv_restart
  • min_salt_install_with_staging
  • srv_sync_channels
  • srv_scc_user_credentials
  • srv_task_status_engine
  • srv_maintenance_windows
  • min_salt_lock_packages
  • min_bootstrap_negative
  • min_change_software_channel
  • srv_osimage
  • buildhost_bootstrap
  • srv_enable_sync_products
  • min_cve_id_new_syntax
  • allcli_software_channels
  • min_rhlike_salt
  • srv_create_repository
  • minssh_action_chain
  • srv_menu
  • srv_advanced_search

@wweellddeerr wweellddeerr force-pushed the appstreams-activation-key branch 3 times, most recently from 7035753 to c79a0ea Compare June 17, 2024 11:26
@wweellddeerr wweellddeerr changed the title WIP: Configure AppStreams via Activation Keys Configure AppStreams via Activation Keys Jun 17, 2024
@wweellddeerr wweellddeerr marked this pull request as ready for review June 17, 2024 13:47
@wweellddeerr wweellddeerr requested review from a team as code owners June 17, 2024 13:47
@wweellddeerr wweellddeerr requested review from cbbayburt and removed request for a team June 17, 2024 13:47
Etheryte
Etheryte previously approved these changes Jun 18, 2024
Copy link
Member

@Etheryte Etheryte left a comment

Choose a reason for hiding this comment

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

Two small questions from the frontend side, looks good to go otherwise. 👍

Copy link
Contributor

@cbbayburt cbbayburt left a comment

Choose a reason for hiding this comment

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

Thanks, @wweellddeerr, it's a very neat solution.

I've tested it successfully on my setup, and the code looks good as well.

There are still some things to do AFAICS:

  • Unit tests where applicable (for ActivationKeyManager, utils.ts, etc.)
  • API endpoints for the activationkeys namespace
    • addAppStreams
    • removeAppStreams
    • Include appstream info in getDetails
    • Test if the rest of the endpoints work together well (clone)
  • Documentation updates for AKs (creating a separate issue will do)

Finally, it would be nice to have additional code comments in places where some complex logic is involved. Some parts especially in the TS domain took me some time to understand properly. When time passes, this will be even harder.

Since we're not in a rush to merge this, I think we can do all of the above with additional commits to this PR.

@cbbayburt
Copy link
Contributor

Hi @mcalmer, we can use another pair of eyes on the activation key logic (RegistrationUtils.java) to make sure we're not missing anything:

https://github.com/uyuni-project/uyuni/pull/8909/files#diff-dcf2fa4cad7326deac01653f37cec965ef99ddc4656e83c83f61de0812879b88

@@ -136,11 +141,15 @@ public static void finishRegistration(MinionServer minion, Optional<ActivationKe
// SSH Minions need this to set last booted value.
statesToApply.add(ApplyStatesEventMessage.SYSTEM_INFO);
}

handleActivationKeyAppStreams(activationKey, statesToApply, statesToApplyPillar);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is called at the wrong place.
The statesToApply is a list which is executed in the order of the list.
With this order you might install packages from a stream you have not enabled yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. I'll fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants