Skip to content

Conversation

@johanib
Copy link
Contributor

@johanib johanib commented Dec 9, 2025

Prior to this change, the DeprovisionController would return an array of error messages in case something went wrong. This is not the standard behaviour of stepup components. This change ensures the error message is a string.

User lifecycle handles both an array of strings and a string.

Also add a test to ensure a notice is logged if an unknown user is deprovisioned.

Fixes #495

@MKodde
Copy link
Member

MKodde commented Dec 11, 2025

Nice work, especially on widening the test coverage!

However.. I do not thing we need to implode the error messages to a comma seperated string. Before I thought that would be the solution to the issue. But the issue was already solved in user lifecycle itself. At least, when I check out main of user lifecycle in a container. And run the deprovision console command there. Middleware can return strings or arrays of strings in its error response. And all is logged to the console neatly.

See output below:

# ./bin/console deprovision urn:collab:person:kwaak          
Continue with deprovisioning of "urn:collab:person:kwaak"? (y/n) y
The user was removed from 1 service.
See error messages below:

 * OpenConext Middleware: Kwakka, Extra error message 1, Extra error message 9

Full output of the deprovision command:

[{"name":"OpenConext Middleware","status":"FAILED","data":[],"message":"Kwakka, Extra error message 1, Extra error message 9"}]

I advise to roll back the implode change, and maybe update the new tests if they are still relevant to the existing behavior.

This adds test coverage for the logging of a notice when a non-existing
identity is deprovisioned.
@johanib johanib force-pushed the feature/issue-495_deprovision-tweaks branch from 74c1fec to 0a9a75b Compare December 11, 2025 14:40
@johanib
Copy link
Contributor Author

johanib commented Dec 11, 2025

Nice work, especially on widening the test coverage!

However.. I do not thing we need to implode the error messages to a comma seperated string. Before I thought that would be the solution to the issue. But the issue was already solved in user lifecycle itself. At least, when I check out main of user lifecycle in a container. And run the deprovision console command there. Middleware can return strings or arrays of strings in its error response. And all is logged to the console neatly.

See output below:

# ./bin/console deprovision urn:collab:person:kwaak          
Continue with deprovisioning of "urn:collab:person:kwaak"? (y/n) y
The user was removed from 1 service.
See error messages below:

 * OpenConext Middleware: Kwakka, Extra error message 1, Extra error message 9

Full output of the deprovision command:

[{"name":"OpenConext Middleware","status":"FAILED","data":[],"message":"Kwakka, Extra error message 1, Extra error message 9"}]

I advise to roll back the implode change, and maybe update the new tests if they are still relevant to the existing behavior.

✔️ After discussion, makes sense.
This is already fixed in user-lifecycle.

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.

Deprovision fails with user lifecycle

3 participants