Skip to content

Add check branching validation#2

Merged
maekind merged 6 commits intomainfrom
feature/Create_branching_validation
Dec 23, 2024
Merged

Add check branching validation#2
maekind merged 6 commits intomainfrom
feature/Create_branching_validation

Conversation

@maekind
Copy link
Owner

@maekind maekind commented Dec 19, 2024

  • .github: repository files added. Release action created to use my new github-action for publishing using uv.
  • Cli: I have separated the commands and added the option --detect-branches in the validate.
  • Validator: I have created the _branches method which will verify if there are branches in the graph.
  • Logger: Fix some issues with a verbose option in the CLI.
  • CustomFormatter: I have automated the fmt build using its own field definition. Before, fields were duplicated in the custom formatted and logger.
  • Tests: Create some more tests to cover new functionality.
  • README: updated.

Add release action

Add pre-commit configuration
@maekind maekind force-pushed the feature/Create_branching_validation branch from 94a8dad to 9a50e92 Compare December 19, 2024 15:15
@codecov
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.75%. Comparing base (47cc5fa) to head (ee40bb6).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #2      +/-   ##
==========================================
+ Coverage   89.79%   92.75%   +2.95%     
==========================================
  Files           6        6              
  Lines          98      138      +40     
==========================================
+ Hits           88      128      +40     
  Misses         10       10              
Flag Coverage Δ
unittests 92.75% <ø> (+2.95%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maekind maekind requested a review from GerardSoleCa December 19, 2024 16:33
False, "--verbose", help="Show migrations validation logs."
),
detect_branches: bool = typer.Option(
False, "--detect-branches", help="Include branching in the validation."
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest to improve a bit the help. You are stating that the includes the branching, but not that fails when branches are found

Copy link
Owner Author

Choose a reason for hiding this comment

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

I have enriched the message explaining that validation will fail if branches are found.

str: The formatted log message
"""
base_fmt = base_fmt or "%(levelname)s\t %(asctime)s | %(message)s | "
dynamic_fields = "".join([f"%({field})s" for field in fields])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't be better to join with a blank space?

dynamic_fields = " ".join([f"%({field})s" for field in fields])

Or maybe this is already doing this, just asking/guessing...

Copy link
Owner Author

Choose a reason for hiding this comment

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

In one logging line there will only be one of the fields. So, it’s better to not have spaces in between so we will have weird formatted lines.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, so dynamic_fields will contain only one field to be serialized in the logs?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Clarified offline

Copy link
Owner Author

Choose a reason for hiding this comment

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

Exactly.

@maekind maekind force-pushed the feature/Create_branching_validation branch from b1e8932 to 4495220 Compare December 19, 2024 21:08
@maekind maekind force-pushed the feature/Create_branching_validation branch from 3a6f6b0 to ee40bb6 Compare December 19, 2024 21:44
@maekind maekind merged commit 548c641 into main Dec 23, 2024
4 checks passed
@maekind maekind deleted the feature/Create_branching_validation branch December 23, 2024 09:06
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.

2 participants