To fix this, we first check if the ast is an array, and if so, run filter_linebreaks on that.
After fixing this, a KeyError error occurred in a local run here.
~With the fix, it just logs a warning and returns None:~
The KeyError was caused by the parent page being a database, so the page_id key did not exist. The fix checks the type (which should be one of: workspace, block_id, or page_id) and returns the appropriate parent (None for workspace, database for block_id, and page for page_id.
How Did You Test It
Ran pytest tests with all tests passing
Installed locally and run n2y publish_config.yml --verbosity=INFO in the site repo successfully.
Context
After merging #155, I manually ran the
publish-documents
workflow, which failed with a different error: https://github.com/innolitics/innolitics.github.io/actions/runs/6357254369/job/17268129193This was due to a
BulletList
being passed here.To fix this, we first check if the
ast
is an array, and if so, runfilter_linebreaks
on that.After fixing this, a
KeyError
error occurred in a local run here.~With the fix, it just logs a warning and returns
None
:~The
KeyError
was caused by the parent page being a database, so thepage_id
key did not exist. The fix checks thetype
(which should be one of:workspace
,block_id
, orpage_id
) and returns the appropriate parent (None
forworkspace
,database
forblock_id
, andpage
forpage_id
.How Did You Test It
pytest tests
with all tests passingn2y publish_config.yml --verbosity=INFO
in the site repo successfully.