Skip to content
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

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

Merged
merged 8 commits into from Jun 1, 2023
Merged

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

merged 8 commits into from Jun 1, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented May 29, 2023

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
Copy link
Contributor

github-actions bot commented May 29, 2023

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)

Added images

  • pygmt/tests/baseline/test_basemap_added.png

Modified images

Path Old New
test_basemap.png

Report last updated at commit bf5c6f6

@github-actions
Copy link
Contributor

github-actions bot commented May 29, 2023

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)

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
Copy link
Member

@weiji14 weiji14 left a comment

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 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
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
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
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
16 checks passed
@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.

None yet

3 participants