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

Fixes #19650: Need a migration script about changes in system directives, groups and rules #3898

Conversation

fanf
Copy link
Member

@fanf fanf commented Sep 24, 2021

@fanf
Copy link
Member Author

fanf commented Sep 24, 2021

PR rebased

@fanf fanf force-pushed the bug_19650/need_a_migration_script_about_changes_in_system_directives_groups_and_rules branch from 547594b to a106934 Compare September 24, 2021 23:46
@fanf
Copy link
Member Author

fanf commented Sep 24, 2021

PR updated with a new commit

@@ -948,7 +948,7 @@ class WoLDAPDirectiveRepository(
}
}
categoryEntry <- getCategoryEntry(con, categoryId, "1.1").notOptional(s"Category entry with ID '${categoryId.value}' was not found")
newActiveTechnique = ActiveTechnique(ActiveTechniqueId(uuidGen.newUuid),techniqueName, versions.map(x => x -> DateTime.now()).toMap)
newActiveTechnique = ActiveTechnique(ActiveTechniqueId(techniqueName.value),techniqueName, versions.map(x => x -> DateTime.now()).toMap)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a big change. It means that now, newly added active techniques have the same name as their technique, and not an uuid (ie like system techniques)

@@ -278,26 +278,24 @@ class TechniqueAcceptationUpdater(
//ignore ? => do nothing
UIO.unit
case Some(t) =>
//if the technique is system, we must not add it to UserTechniqueLib, the process
//must be handled by a dedicated action. Only update system techniques!
Copy link
Member Author

Choose a reason for hiding this comment

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

so actually, yes, we want to auto-add it, but there's still a subtility, because the category name does not match

private def getLdap(con: RwLDAPConnection) = {
for {
entry <- con.get(dit.APPCONFIG.propertyDN(RudderWebPropertyName(PROP_NAME))).notOptional(s"LDAP setting entry ${PROP_NAME} was not found. It may be a bug, please report it.")
Copy link
Member Author

Choose a reason for hiding this comment

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

we need to be able to be missing allowed network setting at the begining of migration from 6.2

@@ -508,15 +509,11 @@ ootapja6lKOaIpqp0kmmYN7gFIhp
*
*/

class TestNodeConfiguration(prefixTestResources: String = "") {
class TestTechniqueRepo(prefixTestResources: String = ""
Copy link
Member Author

Choose a reason for hiding this comment

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

be able to just use technique repo & git test services (and override gitRevisionProvider)

@@ -0,0 +1,9 @@

Copy link
Member Author

Choose a reason for hiding this comment

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

there is only one remaining interesting file below (TestMigrateSystemTechnique7_0.scala), other are just technique files for the test techniqueRepo

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/3898
-- Your faithful QA
Kant merge: "Thoughts without content are empty, intuitions without concepts are blind."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/44803/console)

@fanf
Copy link
Member Author

fanf commented Sep 27, 2021

OK, squash merging this PR

@fanf fanf force-pushed the bug_19650/need_a_migration_script_about_changes_in_system_directives_groups_and_rules branch from 49b8a39 to f491892 Compare September 27, 2021 15:53
@fanf fanf merged commit f491892 into Normation:branches/rudder/7.0 Sep 27, 2021
@fanf fanf deleted the bug_19650/need_a_migration_script_about_changes_in_system_directives_groups_and_rules branch March 15, 2024 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants