Skip to content

GEN-1234 - Clean up suggestions when a user is deleted - #17988

Merged
pmbrull merged 7 commits into
open-metadata:mainfrom
pmbrull:GEN-1234
Sep 26, 2024
Merged

pmbrull merged 7 commits into
open-metadata:mainfrom
pmbrull:GEN-1234

Conversation

@pmbrull

@pmbrull pmbrull commented Sep 25, 2024

Copy link
Copy Markdown
Member

Describe your changes:

  • We had an error when trying to Accept All suggestions from a user that was deleted
  • This was due us deleting the relationships of that user (user <> suggestion relationship) but not the suggestions.
  • In this PR, we are properly cleaning up the environment. Once a user is deleted, the suggestions it created will be deleted as well
  • Note that during testing we tried to replicate the scenario by creating bots - to make it as similar to the MetaPilot as possible. We noticed that the JWT json schema had a wrongly set required jwtToken when creating a bot user

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

@pmbrull
pmbrull requested review from a team as code owners September 25, 2024 09:19
@notion-workspace

Copy link
Copy Markdown

AuthenticationMechanism.__name__: "/users/auth-mechanism",
Bot.__name__: "/bots", # We won't allow bot creation from the client
Bot.__name__: "/bots",
CreateBot.__name__: "/bots",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

useful for testing

if (nullOrEmpty(suggestions)) {
return new ResultList<>(suggestions, null, null, total);
}
beforeCursor = after == null ? null : suggestions.get(0).getUpdatedAt().toString();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

without the check we got index out of bounds

},
"additionalProperties": false,
"required": ["JWTToken", "JWTTokenExpiry"]
"required": ["JWTTokenExpiry"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the JWTToken is created in the backend, no need to pass it when creating a user

@github-actions

Copy link
Copy Markdown
Contributor

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

sushi30
sushi30 previously approved these changes Sep 25, 2024
@sonarqubecloud

Copy link
Copy Markdown

@pmbrull
pmbrull merged commit d264495 into open-metadata:main Sep 26, 2024
pmbrull added a commit that referenced this pull request Oct 25, 2024
* GEN-1234 - Clean up suggestions when a user is deleted

* add method

* add method

* fix postgres query

This branch had an error being deployed

1 failed deployment
test — d0c75878 Deployed Sep 26, 2024 by pmbrull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants