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

Fix persisting the Cobbler UID in the database via XML-RPC createSystemRecord (bsc#1207532) #7738

Merged
merged 15 commits into from
Nov 22, 2023

Conversation

meaksh
Copy link
Member

@meaksh meaksh commented Oct 23, 2023

What does this PR change?

This is just a recreation of #6676 in a Uyuni branch.

GUI diff

No difference.

  • DONE

Documentation

  • No documentation needed: only internal and user invisible changes

  • DONE

Test coverage

  • Unit tests were added

  • DONE

Links

Tracks https://github.com/SUSE/spacewalk/issues/20333

  • 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"

@meaksh meaksh requested review from a team as code owners October 23, 2023 10:24
@meaksh meaksh requested review from Etheryte and cbbayburt and removed request for a team October 23, 2023 10:24
@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

👋 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/7738/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/7738/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:

For more tips on troubleshooting, see the troubleshooting guide.

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

Suggested tests to cover this Pull Request
  • srv_rename_hostname
  • allcli_sanity
  • srv_cobbler_profile
  • srv_monitoring
  • srv_distro_cobbler
  • proxy_cobbler_pxeboot
  • srv_cobbler_distro
  • minkvm_guests
  • proxy_branch_network
  • minssh_salt_install_package
  • min_deblike_monitoring
  • srv_power_management
  • min_salt_mgrcompat_state
  • allcli_software_channels_dependencies
  • allcli_system_group
  • srv_docker_cve_audit
  • min_empty_system_profiles
  • srv_restart
  • min_ansible_control_node
  • srv_reportdb
  • srv_power_management_redfish
  • min_retracted_patches
  • min_bootstrap_negative
  • srv_user_configuration_salt_states
  • min_activationkey
  • allcli_reboot
  • min_bootstrap_ssh_key
  • srv_manage_activationkey
  • min_rhlike_salt
  • min_salt_formulas_advanced
  • srv_manage_channels_page
  • min_deblike_salt_install_package
  • buildhost_docker_build_image
  • min_salt_migration
  • srv_custom_system_info
  • min_recurring_action
  • proxy_as_pod_basic_tests
  • minssh_bootstrap_api
  • srv_advanced_search
  • min_salt_minion_details
  • min_salt_lock_packages
  • srv_scc_user_credentials
  • min_deblike_openscap_audit
  • min_rhlike_ssh
  • min_check_patches_install
  • min_virthost
  • srv_datepicker
  • srv_power_management_api
  • min_salt_openscap_audit
  • min_salt_install_with_staging
  • min_move_from_and_to_proxy
  • allcli_config_channel
  • min_project_lotus
  • min_salt_software_states
  • min_config_state_channel_subscriptions
  • min_timezone
  • min_bootstrap_api
  • min_bootstrap_reactivation
  • min_rhlike_monitoring
  • min_salt_user_states
  • minssh_ansible_control_node
  • min_rhlike_salt_install_package_and_patch
  • min_config_state_channel_api
  • min_deblike_salt
  • buildhost_docker_auth_registry
  • buildhost_osimage_build_image
  • min_deblike_salt_install_with_staging
  • srv_group_union_intersection
  • min_cve_audit
  • min_rhlike_remote_command
  • allcli_action_chain
  • min_salt_pkgset_beacon
  • proxy_retail_pxeboot_and_mass_import
  • buildhost_bootstrap
  • min_rhlike_openscap_audit
  • min_bootstrap_script
  • srv_virtual_host_manager
  • proxy_register_as_minion_with_script
  • min_cve_id_new_syntax
  • min_deblike_ssh
  • min_salt_install_package
  • min_config_state_channel
  • min_salt_minions_page
  • srv_menu
  • min_monitoring
  • min_change_software_channel
  • min_action_chain
  • min_deblike_remote_command
  • minssh_action_chain
  • sle_ssh_minion
  • min_salt_formulas
  • allcli_overview_systems_details
  • min_custom_pkg_download_endpoint
  • allcli_software_channels
  • srv_maintenance_windows
  • sle_minion
  • min_ssh_tunnel
  • minssh_move_from_and_to_proxy
  • srv_first_settings
  • srv_cobbler_sync
  • srv_cobbler_buildiso

@Etheryte Etheryte removed their request for review October 23, 2023 13:00
@mcalmer
Copy link
Contributor

mcalmer commented Oct 24, 2023

@jordimassaguerpla said yesterday the acceptance tests should work. But they still fail in the same way as in the last days. Do we need to rebase only or do we have a real problem?

@mcalmer mcalmer force-pushed the master-fix/xml-rpc-createSystemRecord branch from b2831b6 to 98eb953 Compare October 24, 2023 08:55
@mcalmer
Copy link
Contributor

mcalmer commented Oct 24, 2023

@jordimassaguerpla I rebased and we still have all these errors. I do not think that the code here cause them. Anything known currently?

Copy link
Contributor

@mcalmer mcalmer left a comment

Choose a reason for hiding this comment

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

LGTM

@meaksh meaksh changed the title Fix persisting the Cobbler UID in the database via XML-RPC createSystemRecord Fix persisting the Cobbler UID in the database via XML-RPC createSystemRecord (bsc#1207532) Oct 26, 2023
@@ -171,7 +171,7 @@ protected static List<Map<String, Object>> lookupDataMapsByCriteria(
Map<String, String> criteria = new HashMap<>();
criteria.put(critera, value);
return (List<Map<String, Object>>)
client.invokeTokenMethod(findMethod, criteria);
client.invokeTokenMethod(findMethod, criteria, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be wrong. Paramater needs to be "true": See also https://github.com/SUSE/spacewalk/pull/22954

Copy link
Member Author

Choose a reason for hiding this comment

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

@mcalmer I see you have added few more commits to this PR after you did this review.

Is this PR ready to be merged now?

Thanks in advance!

@mcalmer mcalmer force-pushed the master-fix/xml-rpc-createSystemRecord branch from 930af89 to bf50e3a Compare November 4, 2023 14:05
This commit addresses a regression that was introduced in 92e5a19.

When the server object is not passed to CobblerSystemCreateCommand the Cobbler UID is not persisted in the database which leads to Cobbler rejecting the API requests that SUSE Manager does.

This doesn't happen via the UI since it passes the server object via a different constructor than the XML-RPC API.
@mcalmer mcalmer force-pushed the master-fix/xml-rpc-createSystemRecord branch from 57ac52e to 838abe3 Compare November 20, 2023 16:43
Copy link
Contributor

@mcalmer mcalmer left a comment

Choose a reason for hiding this comment

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

LGTM

@meaksh
Copy link
Member Author

meaksh commented Nov 22, 2023

The current failure we see in acceptances-tests is not really caused by this PR. It is actually a timing issue in the testsuite:

Text '28 minutes ago' not found (ScriptError)

While screenshot shows 27 minutes ago.

So I'm merging this PR now.

@meaksh meaksh merged commit 6da81f2 into master Nov 22, 2023
16 of 17 checks passed
@meaksh meaksh deleted the master-fix/xml-rpc-createSystemRecord branch November 22, 2023 10:10
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.

5 participants