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

feat: implement column created_by_user_id in feature_tag #5695

Merged
merged 6 commits into from
Dec 21, 2023

Conversation

daveleek
Copy link
Contributor

@daveleek daveleek commented Dec 20, 2023

About the changes

Adds the new nullable column created_by_user_id to the data used by feature-tag-store and feature-tag-service. Also updates openapi schemas.

Copy link

vercel bot commented Dec 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2023 7:31am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Dec 21, 2023 7:31am

Copy link
Contributor

@gastonfournier gastonfournier left a comment

Choose a reason for hiding this comment

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

The PR makes sense, I'm not sure about import not having the created_by. When you import, you are the culprit (or creator :P) of that imported tag

@@ -24,4 +24,6 @@ export interface FeatureTagSchema {
* @deprecated
*/
value?: string;
/** The id of the user who created this tag */
createdByUserId?: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

If previously it didn't have a user, can we assume system here? I mean to avoid having it nullable, I feel we're not accomplishing our goal if this is nullable

@@ -35,6 +35,12 @@ export const featureTagSchema = {
description:
'The value of the tag. This property is deprecated and will be removed in a future version of Unleash. Superseded by the `tagValue` property.',
},
createdByUserId: {
type: 'number',
nullable: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note so we don't forget: maybe we need to make this not nullable, but if this is used as input it might be a breaking change for the API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah this is part of import/export. So I think it needs to be nullable

@@ -159,4 +159,5 @@ export const featureTagSchema = joi.object().keys({
tagValue: joi.string(),
type: nameType.optional(),
value: joi.string().optional(),
createdByUserId: joi.number().optional(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is used to validate input. And I believe all new input should have a createdById (but maybe it's a breaking change for the API)

Copy link
Contributor

@gastonfournier gastonfournier left a comment

Choose a reason for hiding this comment

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

LGTM! We agreed on Slack that we might be able to find out who was the actor by looking at the events log, so keeping the field null for now seems reasonable, despite not being sure if we're going to embark on that task.

@daveleek daveleek merged commit 4e56d1d into main Dec 21, 2023
13 checks passed
@daveleek daveleek deleted the feat/feature-tags-createdbyuserid branch December 21, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants