Skip to content
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

feat: adds markdown generation to the rules transform entrypoint #282

Merged
merged 8 commits into from
Jul 26, 2024

Conversation

jpower432
Copy link
Member

@jpower432 jpower432 commented Jul 24, 2024

Description

This change alters the way rules-transform works currently. Instead of ending the workspace management tasks with OSCAL changes, it ends with Markdown changes. A broader approach necessary for the rules-transform action to be useful on its own because the source of truth for authored model content is Markdown.

  • Adds traceback str to handle_exception in separate commit (needed for debugging tests for this PR)

Fixes #226

Follow On

Not required but there are a lot of flag options here that would be relatively static (e.g. markdown_path) that are used in multiple places. It might be worth exploring using a configuration file for inputs that cannot be automatically populate or do have defaults.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

BREAKING CHANGE: Modifies the existing behavior of the rules transform
entrypoint

Signed-off-by: Jennifer Power <[email protected]>
@jpower432 jpower432 requested a review from gvauter July 24, 2024 20:43
@jpower432
Copy link
Member Author

@gvauter This code is not completely ready yet, but looking for early feedback.

@jpower432 jpower432 marked this pull request as ready for review July 25, 2024 22:07
Copy link
Contributor

@gvauter gvauter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good. I left one suggestion on the traceback handling. Let me know what you think.

@@ -278,10 +278,13 @@ def __init__(self, arg: str, msg: str):


def handle_exception(
exception: Exception, msg: str = "Exception occurred during execution"
exception: Exception,
traceback_str: str,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this an optional kwarg in case someone doesn't implement traceback in their code and only sends the exception?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gvauter Ask discussed, will merge this as is and we can look at other options for exception handling down the road.

@jpower432 jpower432 merged commit 84dec70 into main Jul 26, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add markdown regeneration to the rules transform task
2 participants