apiage: Remove empty tables from API status markdown

There are instances in API status json with empty list for preview or
deprecated APIs. Due to a missing empty check we had corresponding
tables created without any content.

While adding the empty check also modify the condition which adds an
entry indicating absence of any preview/deprecated APIs to consider
empty lists.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
This commit is contained in:
Anoop C S 2022-10-18 12:48:17 +05:30 committed by mergify[bot]
parent 4f5281df0f
commit 1fe5774292
2 changed files with 5 additions and 22 deletions

View File

@ -226,7 +226,7 @@ def format_markdown(tracked, outfh):
for pkg, pkg_api in tracked.items():
print(f"## Package: {pkg}", file=outfh)
print("", file=outfh)
if "preview_api" in pkg_api:
if "preview_api" in pkg_api and pkg_api["preview_api"]:
print("### Preview APIs", file=outfh)
print("", file=outfh)
_table(
@ -239,7 +239,7 @@ def format_markdown(tracked, outfh):
outfh=outfh,
)
print("", file=outfh)
if "deprecated_api" in pkg_api:
if "deprecated_api" in pkg_api and pkg_api["deprecated_api"]:
print("### Deprecated APIs", file=outfh)
print("", file=outfh)
_table(
@ -252,7 +252,8 @@ def format_markdown(tracked, outfh):
outfh=outfh,
)
print("", file=outfh)
if all(x not in pkg_api for x in ("preview_api", "deprecated_api")):
if (all(x not in pkg_api for x in ("preview_api", "deprecated_api")) or
all(x in pkg_api and not pkg_api[x] for x in ("preview_api", "deprecated_api"))):
print("No Preview/Deprecated APIs found. "
"All APIs are considered stable.", file=outfh)
print("", file=outfh)

View File

@ -8,15 +8,7 @@ No Preview/Deprecated APIs found. All APIs are considered stable.
## Package: cephfs/admin
### Preview APIs
Name | Added in Version | Expected Stable Version |
---- | ---------------- | ----------------------- |
### Deprecated APIs
Name | Deprecated in Version | Expected Removal Version |
---- | --------------------- | ------------------------ |
No Preview/Deprecated APIs found. All APIs are considered stable.
## Package: rados
@ -31,11 +23,6 @@ IOContext.RequiresAlignment | v0.17.0 | v0.19.0 |
## Package: rbd
### Preview APIs
Name | Added in Version | Expected Stable Version |
---- | ---------------- | ----------------------- |
### Deprecated APIs
Name | Deprecated in Version | Expected Removal Version |
@ -70,8 +57,3 @@ No Preview/Deprecated APIs found. All APIs are considered stable.
## Package: common/admin/nfs
### Preview APIs
Name | Added in Version | Expected Stable Version |
---- | ---------------- | ----------------------- |