Skip to content

Commit

Permalink
Adapt process_changes.py to process gitlab based entries
Browse files Browse the repository at this point in the history
Closes #944
  • Loading branch information
raph-amiard committed Mar 28, 2023
1 parent 90683f1 commit 7939f57
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions user_manual/changes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ The contents are used for two purposes:
To see what should be documented in each YAML entry, please see
[entry_schema.yaml](./entry_schema.yaml), which uses the [JSON
Schema](https://json-schema.org/) schema description, but with YAML objects.

* Files of the form `S123-456.yaml` are old style ticket entries.

* Files in the `libadalang` and `langkit` directories, and of the form
`123.yaml` are new style Gitlab ticket entries.
16 changes: 14 additions & 2 deletions user_manual/changes/process_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,31 @@ def get_entries(*args):
entries_names = args
else:
entries_names = [
# Old style TN entries live in the base dir
f for f in glob(P.join(ENTRIES_PATH, '*.yaml'))
if P.basename(f) != 'entry_schema.yaml'
]
] + (
# Gitlab entries live in subdirs
glob(P.join(ENTRIES_PATH, "libadalang", "*.yaml"))
+ glob(P.join(ENTRIES_PATH, "langkit", "*.yaml"))
)

for fname in entries_names:
tn = P.basename(fname).split('.')[0]
# With this transformation:
# * Old style ticket numbers will look like S123-456
# * New style Gitlab ticket numbers will look like libadalang-123
tn = P.relpath(
fname, start=ENTRIES_PATH
).split('.')[0].replace("/", "-")

with open(fname, encoding="utf-8") as f:
entry = yaml.safe_load(f)
entry['tn'] = tn
validate_entry(tn, entry)
yield entry



types_to_header = OrderedDict((
('api-change', 'breaking changes'),
('new-feature', 'new features'),
Expand Down

0 comments on commit 7939f57

Please sign in to comment.