Samagra-Development / WarpSQL

WarpSQL
https://samagra-development.github.io/WarpSQL/
Apache License 2.0
15 stars 30 forks source link

add image analysis to github workflow #91

Closed PiyushRaj927 closed 1 year ago

PiyushRaj927 commented 1 year ago

Fixes #42 This PR add workflows that analyze the size differences in the Docker image. The key features of this PR are:

  1. Automatically hides old bot messages.
  2. Updates the Docker image's current statistics when commits are posted to the main branch.

The process involves two workflows: image-analysis.yml and image-analysis-comment.yml.

The image-analysis.yml workflow, which lacks write permissions on issues, is responsible for importing the image, conducting the analysis, exporting the details as comments in the pull request, and updating the comparison metrics when a push occurs on the main branch.

On the other hand, the image-analysis-comment.yml workflow writes the comments to their respective issues and hide bot messages from old runs.

PiyushRaj927 commented 1 year ago

Hey @singhalkarun can you review the PR when you get the chance. The test is failing because forked repos can't have write access in PRs. You can see it working in my forked repo at https://github.com/PiyushRaj927/WarpSQL/pull/3

PiyushRaj927 commented 1 year ago

Hey @singhalkarun can you review the PR when you get the chance. The test is failing because forked repos can't have write access in PRs. You can see it working in my forked repo at PiyushRaj927#3

While I was researching more about the access available to the workflows, I discovered that the pull_request event for forked pull requests doesn't have write access by default, as it poses a security risk. I found a better approach, which involves a two-step process, explained in detail in https://stackoverflow.com/questions/69499645/how-to-securely-allow-github-actions-to-check-pr-and-post-results-in-comment. I will implement this method and incorporate the suggested changes mentioned in the initial review.

singhalkarun commented 1 year ago

sts doesn't have writ

Hey @PiyushRaj927 can we create a different workflow for image analysis if possible to keep things separate?

PiyushRaj927 commented 1 year ago

I have tested the workflow and made the necessary changes. You can see it working at https://github.com/anmolchhabra21/WarpSQL/pull/25.

PiyushRaj927 commented 1 year ago

Hey @singhalkarun, I have added comments and formatted the code. If any part is unclear, please let me know, and I'll provide clarifications. I will also include a document explaining the workflow soon

github-actions[bot] commented 1 year ago

:bar_chart: bitnami Image Analysis (Commit: 807892d00506ef6fc434805dc9d947941c588d39 )

Summary

github-actions[bot] commented 1 year ago

:bar_chart: normal Image Analysis (Commit: f079fa1d7326e6357123f61205fac31747fa3f20 )

Summary