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 #25979: Migrate custom properties along with node properties for consistency #6060

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fanf
Copy link
Member

@fanf fanf commented Nov 29, 2024

https://issues.rudder.io/issues/25979

Ported from first correction of #6059

So, we have two kind of properties for nodes:

  • customProperty comes from inventory and are stored in ou=[Pending, Accepted] Inventories branch,
  • serializedNodeProperty comes from plugin, users, etc and are stored in ou=Nodes branch.

Before 8.0, the separation was mandatory because node entry under ou=Nodes was only created at acceptation time. This limitation was removed in Rudder 8.0.

It makes not architectural sense to have the split persists. We can merge them together in ou=Nodes entries.

@fanf fanf requested a review from clarktsiory November 29, 2024 07:54
Comment on lines +86 to +87
(getNode1PropNamesAsSeenByLdap() must containTheSameElementsAs(List("foo", "datacenter", "from_inv"))) and
(getNode1PropNamesAsSeenByRepo() must containTheSameElementsAs(List("foo", "datacenter", "from_inv")))
Copy link
Contributor

Choose a reason for hiding this comment

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

I forgot but is this really guaranteed to be true i.e. does the other test that adds datacenter, from_inv always execute before this one ?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's in the source data

* in the ou=Accepted Inventories branch, and if so, it save back them so that
* they are moved along with other properties.
* Added in rudder 8.1.8 (https://issues.rudder.io/issues/25978)
* Can be removed in Rudder 8.3
Copy link
Contributor

Choose a reason for hiding this comment

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

This PR is in 8.3, the comment could be misleading, why not removing this file then ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I was not sure if we should put it in 8.1 or not. But there is 0 reasons to do so:

  • it's an architectural change,
  • that doesn't correct any direct bugs

That goes to 8.3. I updated the text accordingly.

…ties for consistency

Fixes #25979: Migrate custom properties along with node properties for consistency
@fanf
Copy link
Member Author

fanf commented Nov 29, 2024

PR updated with a new commit

… properties for consistency

Fixes #25979: Migrate custom properties along with node properties for consistency
@fanf
Copy link
Member Author

fanf commented Nov 29, 2024

PR updated with a new commit

@fanf fanf marked this pull request as draft November 30, 2024 21:51
@fanf
Copy link
Member Author

fanf commented Nov 30, 2024

Given #6063, we will need to think back how to do the migration:

  • now, customProperties are not saved (deleted) when saving the core node fact, since it uses the new inventory method saveUserSetAttributes which does not delete missing attributes.
  • so we could add customProperties to the mapped attributes. It won't do anything appart for the migration
  • or we can handle the migration in an other way.

Perhas we should add customProperties, and also migrate keyStatus in node part, since it's a user-settable think, in one go.

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.

2 participants