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

Add codegen to support deprecated labels #3270

Merged
merged 5 commits into from
Dec 20, 2024
Merged

Conversation

estrattonbailey
Copy link
Member

@estrattonbailey estrattonbailey commented Dec 19, 2024

The gore label is deprecated in favor of graphic-media. However, some moderation actions still result in the gore label being applied. In our frontend codebase, we manually migrate the gore label to graphic-media.

Work is being done to remove the usage of this old label, but we have no definite timeline for complete removal and migration to fully eradicate historical data.

Once we do that migration, the code added in this PR will not be necessary, but:

  • 3p devs likely already have hit this problem, or they likely will
  • we may have more need of this handling in the future

The first commit here ports our existing logic directly into the SDK. The second commit removes that and replaces it with a new gore label definition that duplicates graphic-media. The third is what I think is the "correct" approach, even if naming and such needs to change after we talk about this.

This approach

gore needs to duplicate graphic-media, but we should leave some paper trail of why this is. I've added an alias field to the definitions JSON file so that graphic-media can define gore as an alias. Codegen then uses this alias array to generate additional definitions that duplicate the root def.

Because we don't intent to support aliases, and prefer the root def, I'm also generating a tsdoc @deprecation comment above the alias definition.

@estrattonbailey estrattonbailey marked this pull request as ready for review December 19, 2024 19:25
@estrattonbailey estrattonbailey changed the title Handle deprecated label mapping in SDK Add codegen to support deprecated labels Dec 19, 2024
Copy link
Collaborator

@pfrazee pfrazee left a comment

Choose a reason for hiding this comment

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

Nice, lgtm

@estrattonbailey estrattonbailey merged commit f22383c into main Dec 20, 2024
10 checks passed
@estrattonbailey estrattonbailey deleted the mod-post-wrap branch December 20, 2024 17:58
@github-actions github-actions bot mentioned this pull request Dec 19, 2024
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