Simpler structure for configuration.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- ci-cd
Research direction
The issue does not name specific files or tests; start by locating the TypeScript configuration parser and its configuration tests. Done means the proposed mapping-based YAML structure is accepted, its schema and related behavior are covered, and existing configuration handling remains consistent with the v5 format.
Written by the indexing model from the issue text.
Description
Description:
Instead of requiring every single level of keys below the top level in the configuration file to have a list as a value, restructure to use mappings whenever possible.
In effect, change the config structure so that the following:
some_label:
- any:
- changed-files:
- any-glob-to-any-file:
- pattern1
- pattern2
- all:
- head-branches:
- pattern3
- base-branches:
- pattern4
instead is represented like this:
some_label:
any:
changed-files:
any-glob-to-any-file:
- pattern1
- pattern2
all:
head-branches:
- pattern3
base-branches:
- pattern4
Justification:
The config format used in v4 utilized type based discrimination of the list items for each label in the config to maintain backwards compatibility despite the addition of the all and any syntax. I would argue that requiring a list in this case was less than ideal (JS/TS should be able to easily differentiate between an array and an object, and that type of differentiation would have made the config a bit easier to understand logically), but the backwards compatibility aspect was useful because the new config parser still supported the old format.
With v5 though, this habit of making value under each label be a list of objects or strings was kept and further propagated to the new ‘sub’ configuration items, despite the fact that the new config format is not at all backwards compatible with the old formats.
This has a number of distinct disadvantages for end users:
- The resultant config files include excess boilerplate structure that do not contribute anything to the actual meaning of the configuration, opening up significant possibility of confusion on the part of users who are trying to understand (or write) a given configuration.
- This format is at best rather difficult to write an accurate schema for, if not outright impossible depending on how pedantic you want to be. This makes it harder for users to validate the config file before committing it or before merging changes to it, which is particularly significant because the normal usage of this action as a
pull_request_targethook instead of apull_requesthook means that an invalid config file won’t actually show any errors until after it’s merged, at which point it will fail workflow runs on unrelated PRs.
I also strongly suspect that the code doing the parsing is, in fact, more complex than it would need to be if this proposal were implemented, so this may have long-term benefits for the maintainability of the code.
Are you willing to submit a PR?
Unfortunately not, as I have no background working with TypeScript and recognize that this will probably require some nontrivial changes to the code that parses the config file.
- Dominant language
- TypeScript
- Stars
- 2.5k
- Forks
- 488
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actions/labeler
-
feature request
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
When a workflow is triggered via workflow_dispatch, it cannot match the corresponding branch.Possibly taken @v-chiranjib-swain claimed this 2 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Feature request: top-level `ignore` list for files that should never trigger labelsPossibly taken @janhoy claimed this 104 days ago. Openfeature request
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
feature request
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
feature request
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Similar issues
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
db-ux-design-system/core-web#8856 ·
Maintainers usually reply within 1 day
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footerPossibly taken @wittdennis claimed this today. Openpriority: p3 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
googleapis/release-please#2971 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
🛠️ dette technique
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
betagouv/mon-entreprise#4752 · 1 comment ·
Maintainers usually reply within 5 days