Skip to content

Commit

Permalink
better comment
Browse files Browse the repository at this point in the history
  • Loading branch information
maxschulz-COL committed Oct 17, 2024
1 parent 11fa974 commit f5052c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/pycafe-dashboards-in-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ jobs:
path: vizro-core/dist/*.whl
retention-days: 5

# - name: Fetch latest commit from target branch
# run: |
# # git fetch origin ${{ github.ref_name }}
# latest_commit=${{ github.sha }}
# echo "COMMIT_HASH=$latest_commit" >> $GITHUB_ENV
# run_id=${{ github.run_id }}
# echo "RUN_ID=$run_id" >> $GITHUB_ENV

# - name: Display latest commit
# run: |
# echo "Latest commit on target branch: ${{ env.COMMIT_HASH }}"
# echo "Latest run id: ${{ env.RUN_ID }}"

# - name: Run Py.Cafe tool
# run: |
# python tools/pycafe/create_py_cafe_url.py

- name: Run Github Tool
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down
17 changes: 11 additions & 6 deletions tools/pycafe/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def post_comment(urls: list[tuple[str, str]]):
# Find existing comments by the bot
comments = pr.get_issue_comments()
bot_comment = None

print(comments)
for comment in comments:
if comment.body.startswith("iew the dashboard live on PyCafe:"):
if comment.body.startswith("View the dashboard live on PyCafe:"):
bot_comment = comment
break

Expand All @@ -93,10 +93,15 @@ def post_comment(urls: list[tuple[str, str]]):

# Define the comment body with datetime
# comment_body = f"Test Environment for [{REPO_NAME}-{PR_NUMBER}]({link})\nUpdated on: {current_utc_time}"
comment_body = "\n\n".join(
f"View the dashboard live on PyCafe: [{directory}]({url})\n\nUpdated on: {current_utc_time}"
for url, directory in urls
)
dashboards = "\n\n".join(f"View the dashboard live on PyCafe: [{directory}]({url})" for url, directory in urls)

comment_body = f"""View the example dashboards of the current commit live on PyCafe:
Updated on: {current_utc_time}
Commit: {commit_sha}
{dashboards}
"""

# Update the existing comment or create a new one
if bot_comment:
Expand Down

0 comments on commit f5052c8

Please sign in to comment.