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

Fix missing command arguments #17

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

fmigneault
Copy link
Contributor

Follow-up to #16, adding the missing parameters to the commands so they are employed when called as action.

@vsoch
Copy link
Contributor

vsoch commented Dec 21, 2024

This looks good - I'll need to squash and merge.

You might consider in the future doing PRs from a feature branch (and not main). What happens is that when commits are squashed and merged, all of your sudden your main branch will have commits that upstream does not, and they show up in PRs as they do here when they are in fact old commits. Generally speaking your main branch should always be in sync with upstream's main branch, so this is an erroneous state.

@fmigneault
Copy link
Contributor Author

Thanks for the explanation about the branch. I was not aware of this technicality. Should I reopen this PR as a branch directly?

@vsoch
Copy link
Contributor

vsoch commented Jan 1, 2025

Thanks for the explanation about the branch. I was not aware of this technicality. Should I reopen this PR as a branch directly?

No need - that is mostly for your FYI (I went many years seeing these "ghost commits" show up in my PRs and I didn't know why!)

@fmigneault fmigneault requested a review from vsoch January 21, 2025 15:20
action.yml Outdated
run: |
command="python ${{ github.action_path }}/scripts/deploy.py upload ${archive} --version ${version}"
if [[ "${doi}" != "" ]]; then
command="$command --doi ${doi}"
command="$command --doi '${doi}'"
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you tested these changes? The single quote I think would not expand the variables, e.g.,

$ doi=testing
$ echo '${doi}'
${doi}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've tried the entire run command within a bash script (but replace python by echo).
Doing doi=testing test.sh expands as echo ... --doi 'testing' when evaluating the command variable.
It wouldn't be expanded if python '${doi}' was called directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

> version=1.2.3 archive=x doi=testing title="some spaces" /tmp/test.sh
echo /scripts/deploy.py upload x --version 1.2.3 --doi 'testing' --title 'some spaces'
/scripts/deploy.py upload x --version 1.2.3 --doi 'testing' --title 'some spaces'

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you show me a test run as a sanity check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good.
I should have a new release soon in the repo where the action is configured. Will report back once generated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran the operation, but got an error regarding the quotes applied onto the zenodo config file parameter

https://github.com/crim-ca/weaver/actions/runs/13182215973/job/36795590573

Run fmigneault/zenodo-release@main
Run command="python /home/runner/work/_actions/fmigneault/zenodo-release/main/scripts/deploy.py upload ${archive} --version ${version}"
python /home/runner/work/_actions/fmigneault/zenodo-release/main/scripts/deploy.py upload weaver-6.2.0.zip --version 6.2.0 --doi '10.5281/zenodo.14210717' --description '<div class="section" id="section-1"><h1><a class="reference external" href="https://github.com/crim-ca/weaver/tree/6.2.0">6.2.0</a> (2025-02-06)</h1><p></p><div class="section" id="changes"><h2>Changes:</h2><ul class="simple"><li>Replace <tt class="docutils literal">succeeded</tt> status by <tt class="docutils literal">successful</tt> everywhere where applicable (as originally defined by OGC API v1),to align with reversal of the proposed draft name, aligning between both v1 and v2 of <cite>OGC API - Processes</cite>(relates to <a class="reference external" href="https://github.com/opengeospatial/ogcapi-processes/pull/483">opengeospatial/ogcapi-processes#483</a>).</li><li>Modify <cite>Job</cite> <tt class="docutils literal">subscribers</tt> definition to employ the normalized <tt class="docutils literal">weaver.status.StatusCategory</tt> insteadof <tt class="docutils literal">weaver.status.Status</tt> as mapping keys, such that email and callback notifications are unified undera common naming convention regardless of the resolved <tt class="docutils literal">weaver.status.StatusCompliant</tt> representation.</li></ul></div><div class="section" id="fixes"><h2>Fixes:</h2><ul class="simple"><li>Fix <tt class="docutils literal">weaver.cli.RequestAuthHandler</tt> and its derived classes erroneously invoking <tt class="docutils literal">request_auth</tt> method whenboth the <tt class="docutils literal">url</tt> and <tt class="docutils literal">token</tt> are omitted, leading to invalid <tt class="docutils literal">requests</tt> call under <tt class="docutils literal">weaver.utils.request_extra</tt>.</li></ul></div></div>' --zenodo-json '.zenodo.json' --html-url 'https://github.com/crim-ca/weaver/tree/6.2.0'
'.zenodo.json' does not exist.

I'm not sure why the action is having trouble finding it when quotes are added.
I will try removing them for that parameter only and rerun...

Copy link
Contributor Author

@fmigneault fmigneault Feb 6, 2025

Choose a reason for hiding this comment

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

It worked with all "undo quotes" commits:

Run: https://github.com/crim-ca/weaver/actions/runs/13182215973/job/36797537562
Published Record: https://zenodo.org/records/14826363

However, the HTML description still seems to be missing is truncated in the uploaded record...


Run fmigneault/zenodo-release@main
Run command="python /home/runner/work/_actions/fmigneault/zenodo-release/main/scripts/deploy.py upload ${archive} --version ${version}"
python /home/runner/work/_actions/fmigneault/zenodo-release/main/scripts/deploy.py upload weaver-6.2.0.zip --version 6.2.0 --doi 10.5281/zenodo.14210717 --description '<div class="section" id="section-1"><h1><a class="reference external" href="https://github.com/crim-ca/weaver/tree/6.2.0">6.2.0</a> (2025-02-06)</h1><p></p><div class="section" id="changes"><h2>Changes:</h2><ul class="simple"><li>Replace <tt class="docutils literal">succeeded</tt> status by <tt class="docutils literal">successful</tt> everywhere where applicable (as originally defined by OGC API v1),to align with reversal of the proposed draft name, aligning between both v1 and v2 of <cite>OGC API - Processes</cite>(relates to <a class="reference external" href="https://github.com/opengeospatial/ogcapi-processes/pull/483">opengeospatial/ogcapi-processes#483</a>).</li><li>Modify <cite>Job</cite> <tt class="docutils literal">subscribers</tt> definition to employ the normalized <tt class="docutils literal">weaver.status.StatusCategory</tt> insteadof <tt class="docutils literal">weaver.status.Status</tt> as mapping keys, such that email and callback notifications are unified undera common naming convention regardless of the resolved <tt class="docutils literal">weaver.status.StatusCompliant</tt> representation.</li></ul></div><div class="section" id="fixes"><h2>Fixes:</h2><ul class="simple"><li>Fix <tt class="docutils literal">weaver.cli.RequestAuthHandler</tt> and its derived classes erroneously invoking <tt class="docutils literal">request_auth</tt> method whenboth the <tt class="docutils literal">url</tt> and <tt class="docutils literal">token</tt> are omitted, leading to invalid <tt class="docutils literal">requests</tt> call under <tt class="docutils literal">weaver.utils.request_extra</tt>.</li></ul></div></div>' --zenodo-json .zenodo.json --html-url 'https://github.com/crim-ca/weaver/tree/6.2.0'
looking at deposit 10.5281/zenodo.14538764
Found deposit 10.5281/zenodo.14210717! 🎉️
Record
  {
      "created": "2025-02-06T15:59:41.400259+00:00",
      "modified": "2025-02-06T15:59:41.646282+00:00",
      "id": 14826363,
      "conceptrecid": "14210717",
      "doi": "10.5281/zenodo.14826363",
      "conceptdoi": "10.5281/zenodo.14210717",
      "doi_url": "https://doi.org/10.5281/zenodo.14826363",
      "metadata": {
          "title": "crim-ca/weaver:6.2.0",
          "doi": "10.5281/zenodo.14826363",
          "publication_date": "2025-02-06",
          "description": "'&lt;div",
          "access_right": "open",

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. Perhaps either there is a limit (I think more unlikely) or a character that might be truncating the body there?

Copy link
Contributor Author

@fmigneault fmigneault Feb 6, 2025

Choose a reason for hiding this comment

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

Seems more like a parsing coming from the action (maybe when it tries checking if a ${{ }} must be interpreted?). I've successfully updated the Zenodo content by manually providing the same HTML as is.

I will retry again on my next release update using the description_file instead (added in 07d29db) to avoid parsing altogether.

…le path with literal quote in string parameter + use argparse.FileType to raise unresolved file immediately
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants