Skip to content

CI: Fix and simplify the dvc-diff workflow - #2549

Merged
seisman merged 8 commits into
mainfrom
fix-dvc-workflow
Jun 1, 2023
Merged

seisman merged 8 commits into
mainfrom
fix-dvc-workflow

Conversation

@seisman

@seisman seisman commented May 29, 2023 •

Copy link
Copy Markdown
Member

Description of proposed changes

Fix the dvc-diff workflow by setting up nodejs to v16, following the workaround in iterative/cml#1377.

The dvc-diff report was posted using peter-evans/find-comment and peter-evans/create-or-update-comment in the old workflow. These steps are removed and the diff report is posted using a single command cml comment update report.md.

Comment #2549 (comment) is the comment posted by the old workflow and #2549 (comment) is the comment posted by the new workflow (i.e., cml comment update report.md).

TODO:

  • Revert changes in b7ad43b before merging

@github-actions

github-actions Bot commented May 29, 2023 •

Copy link
Copy Markdown
Contributor

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added pygmt/tests/baseline/test_basemap_added.png
deleted pygmt/tests/baseline/test_basemap_loglog.png
modified pygmt/tests/baseline/test_basemap.png

Image diff(s)

Details

Added images

  • pygmt/tests/baseline/test_basemap_added.png

Modified images

Path Old New
test_basemap.png

Report last updated at commit bf5c6f6

@seisman
seisman force-pushed the fix-dvc-workflow branch from 0e43154 to 589d7af Compare May 29, 2023 07:58
@seisman
seisman force-pushed the fix-dvc-workflow branch from 2186354 to bf5c6f6 Compare May 29, 2023 08:26
@seisman
seisman force-pushed the fix-dvc-workflow branch from 4100205 to 8c88125 Compare May 29, 2023 08:34
@github-actions

github-actions Bot commented May 29, 2023 •

Copy link
Copy Markdown
Contributor

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added pygmt/tests/baseline/test_basemap_added.png
deleted pygmt/tests/baseline/test_basemap_loglog.png
modified pygmt/tests/baseline/test_basemap.png

Image diff(s)

Details

Added images

  • pygmt/tests/baseline/test_basemap_added.png

Modified images

Path Old New
test_basemap.png

Report last updated at commit befa95b

@seisman seisman changed the title WIP: Fix the dvc-diff workflow Fix and simplify the dvc-diff workflow May 30, 2023
@seisman seisman changed the title Fix and simplify the dvc-diff workflow CI: Fix and simplify the dvc-diff workflow May 30, 2023
@seisman seisman added maintenance Boring but important stuff for the core devs needs review This PR has higher priority and needs review. labels May 30, 2023
@seisman seisman added this to the 0.10.0 milestone May 30, 2023
@seisman
seisman marked this pull request as ready for review May 30, 2023 11:26
@seisman
seisman requested a review from weiji14 May 30, 2023 11:27

@weiji14 weiji14 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a small suggestion, but otherwise looks good!

Comment thread pygmt/tests/test_basemap.py Outdated
Comment on lines +14 to +24
fig.basemap(region=[10, 70, -3, 8], projection="X10c/6c", frame="afg")
return fig


@pytest.mark.mpl_image_compare
def test_basemap_loglog():
def test_basemap_added():
"""
Create a loglog basemap plot.
Create a simple basemap plot.
"""
fig = Figure()
fig.basemap(
region=[1, 10000, 1e20, 1e25],
projection="X16cl/12cl",
frame=["WS", "x2+lWavelength", "ya1pf3+lPower"],
)
fig.basemap(region=[10, 70, -20, 20], projection="X10c/6c", frame="afg")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Revert changes in b7ad43b before merging

Remember to do the revert!

body: ${{ steps.image-diff.outputs.report }}
edit-mode: replace
# create/update PR comment
cml comment update report.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice that this simplifies so many lines of code!

Comment on lines 44 to 46
# Produce the markdown diff report, which should look like:
# ## Summary of changed images
#

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could update the preview a little bit below here

    # | Status   | Path                                |
    # |----------|-------------------------------------|
    # | added    | pygmt/tests/baseline/test_image.png |
    # | deleted  | pygmt/tests/baseline/test_image2.png |
    # | modified | pygmt/tests/baseline/test_image3.png |
+
+    ## Image diff(s)
+
+    <details>
+    ...
+    </details>
+
+    Report last updated at commit abcdef

@seisman seisman removed the needs review This PR has higher priority and needs review. label Jun 1, 2023
@seisman
seisman merged commit 43dc381 into main Jun 1, 2023
@seisman
seisman deleted the fix-dvc-workflow branch June 1, 2023 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants