-
-
Notifications
You must be signed in to change notification settings - Fork 127
Update commit_and_push_changes function to add a default commit message #1894
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
Conversation
ziadhany
commented
Oct 6, 2025
- Add a default print logger to prevent exceptions
- Bump minecode_pipelines version to 0.0.1b24
Add a default print logger to prevent exceptions Bump minecode_pipelines version to 0.0.1b24 Signed-off-by: ziad hany <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ziadhany See comment below.
Also why use print? why not simply pass self.log while calling commit_and_push_changes? Spraying custom logging mechanisms in pipeline functions defeats the whole purpose of having a centrally controlled logger managed by the pipeline, which helps in proper dissemination of pipeline logs to the run instance and UI.
| if not commit_message: | ||
| author_name = settings.FEDERATEDCODE_GIT_SERVICE_NAME | ||
| author_email = settings.FEDERATEDCODE_GIT_SERVICE_EMAIL | ||
|
|
||
| purls = "\n".join(purls) | ||
| commit_message = textwrap.dedent(f"""\ | ||
| Add {mine_type} results for: | ||
| {purls} | ||
| Tool: {tool_name}@v{tool_version} | ||
| Reference: https://{settings.ALLOWED_HOSTS[0]} | ||
| Signed-off-by: {author_name} <{author_email}> | ||
| """) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why we need to compute commit_message here? when we already take care of missing commit message in commit_changes function.
|
@keshav-space The main error comes from If a pipeline fails before updating a checkpoint, when a new pipeline runs, it starts and tries to commit some data that was already pushed. This raises the error: One way to handle this is to use Why add a print logger by default?
Why add commit_and_push_changes?
|
Please use
Let's not use
I don't get you here. scancode.io/scanpipe/pipes/federatedcode.py Lines 229 to 242 in 23b94ad
And why would we need to compute default commit message in |
|
@keshav-space Ok, I get your point. I didn’t notice we already have a default commit message, and I will close this PR. |