Skip to content

Centralize auto-label mappings into a configuration file#5658

Open
Sanketjadhav31 wants to merge 3 commits into
p4lang:mainfrom
Sanketjadhav31:centralize-auto-label-config
Open

Centralize auto-label mappings into a configuration file#5658
Sanketjadhav31 wants to merge 3 commits into
p4lang:mainfrom
Sanketjadhav31:centralize-auto-label-config

Conversation

@Sanketjadhav31

Copy link
Copy Markdown

Summary

PR that extracts the auto-label mappings into the configuration file makes maintenance and expansion of the mappings easier.

Changes

  • Introduced .github/label-mappings.json that serves as the source of mappings between issue/pull-request labels.
  • Updated the auto-labeling workflow to use the configuration file for mappings.
  • Fixed missing mappings for [ebpf], [ubpf] and [graphs].
  • Removed duplicate mappings by making them case-insensitive.
  • Added documentation on how the configuration looks and how it can be extended.

Testing

  • Verified that configuration is properly loaded.
  • Confirmed that matching stays case-insensitive.
  • Checked that all existing and newly introduced mappings work properly.

Fixes #5649

@chreekat

Copy link
Copy Markdown
Contributor

Thanks for the PR!

As I just wrote in #5649, I don't think adding a configuration file is necessarily a good idea.

Furthermore, in this PR, you still duplicate the labels with the same inconsistencies that #5649 seeks to abolish.

I believe there is an idea worth pursuing here, so I encourage you to propose a different approach.

@Devansh-567

Devansh-567 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR!

As I just wrote in #5649, I don't think adding a configuration file is necessarily a good idea.

Furthermore, in this PR, you still duplicate the labels with the same inconsistencies that #5649 seeks to abolish.

I believe there is an idea worth pursuing here, so I encourage you to propose a different approach.

Thanks for the feedback, @chreekat.

I agree with the concerns about introducing a separate JSON configuration file. After reading your comments, I explored an alternative approach that keeps everything in JavaScript while separating the mapping data from the labeling logic.

The idea is to:

  • Define shared mappings once to eliminate duplication and inconsistencies.
  • Keep issue-specific and PR-specific mappings separate where their semantics differ.
  • Make future mapping updates require changes only to the data section, not the workflow logic.
  • Avoid introducing additional configuration parsing or files.

Please check #5660

@Sanketjadhav31

Copy link
Copy Markdown
Author

Thank you for the comments, @chreekat.

I get your points on introducing a separate configuration file and on duplicating the mappings. I will revise my approach to keep all the things in JavaScript, declare the common mappings only once, and split the issue and PR mappings only where needed.

I will adjust this PR accordingly. Thank you for your guidance!

@fruffy fruffy added the infrastructure Topics related to code style and build and test infrastructure. label Jun 19, 2026
Sanketjadhav31 added a commit to Sanketjadhav31/p4c that referenced this pull request Jun 19, 2026
- Remove JSON configuration file and checkout step
- Organize mappings into shared/issue-specific/PR-specific sections
- Eliminate duplicate mappings (docs/documentation now shared)
- Add missing labels: ebpf, ubpf, graphs
- Normalize case for consistency (P4Testgen -> p4testgen)
- Clearly separate data from logic per reviewer feedback
- Preserve all original functionality and label targets

Addresses maintainer feedback in PR p4lang#5658
@Sanketjadhav31 Sanketjadhav31 force-pushed the centralize-auto-label-config branch from efdf336 to a431cd1 Compare June 19, 2026 16:25
Signed-off-by: Sanketjadhav31 <sj546400@gmail.com>
- Remove JSON configuration file and checkout step
- Organize mappings into shared/issue-specific/PR-specific sections
- Eliminate duplicate mappings (docs/documentation now shared)
- Add missing labels: ebpf, ubpf, graphs
- Normalize case for consistency (P4Testgen -> p4testgen)
- Clearly separate data from logic per reviewer feedback
- Preserve all original functionality and label targets

Addresses maintainer feedback in PR p4lang#5658

Signed-off-by: Sanketjadhav31 <sj546400@gmail.com>
Removed unnecessary comment sections from auto-label workflow.

Signed-off-by: Sanket Jadhav <sj546400@gmail.com>
Signed-off-by: Sanketjadhav31 <sj546400@gmail.com>
@Sanketjadhav31 Sanketjadhav31 force-pushed the centralize-auto-label-config branch from b65bc71 to b4f1b8f Compare June 19, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Topics related to code style and build and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centralize auto-label mappings into a config file

4 participants