Skip to content

Remove notes field from label configuration file #699

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

Merged
merged 1 commit into from
Mar 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove notes field from label configuration file
At the time the reference configuration file was developed, it was in JSON, which does not support comments. I found the
need to add some internal explanatory commentary to some of the labels, so I added an arbitrary `notes` key as a
container for this information, and our JSON schema was also configured to accept this field.

I later decided to convert the files to YAML, since that is the language used by the majority of the asset configuration
files. At this point it became possible to use comments, but the `notes` field was already in place so it
seemed pointless to change it.

Validation of the configuration file was added to the "GitHub Label Sync" tool in the recent 2.1.0 release. Before
2.1.0, the tool ignored any additional properties in the label configuration objects. It now errors if there are any
unexpected properties.

This `notes` field now causes the configuration files that contain it to be considered invalid by the tool, and by our
custom JSON schema:

```
.github/label-configuration-files/labels.yml invalid
[
  {
    instancePath: '/0',
    schemaPath: '#/items/additionalProperties',
    keyword: 'additionalProperties',
    params: { additionalProperty: 'notes' },
    message: 'must NOT have additional properties'
  },
  {
    instancePath: '/1',
    schemaPath: '#/items/additionalProperties',
    keyword: 'additionalProperties',
    params: { additionalProperty: 'notes' },
    message: 'must NOT have additional properties'
  }
]
```

So the `notes` field is hereby removed, with the contents moved to comments.
  • Loading branch information
per1234 authored Mar 31, 2022
commit e7c9daf526d22ca7cc0b04ad2bc0c813049f7458
6 changes: 2 additions & 4 deletions .github/label-configuration-files/labels.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Used by the "Sync Labels" workflow
# See: https://github.com/Financial-Times/github-label-sync#label-config-file

# Added by the "Close stale issues" workflow.
- name: "conclusion: stale"
color: "940404"
description: Closed due to lack of activity
notes: |
Added by the "Close stale issues" workflow.
# Added by the "Close stale issues" workflow.
- name: "status: stale"
color: "940404"
description: Pending closure due to lack of activity
notes: |
Added by the "Close stale issues" workflow.