Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
List of MorphoCloudWorkflow changes:

```
$ git shortlog 605af12..5f1d3ee --no-merges
Jean-Christophe Fillion-Robin (6):
      fix: Simplify action log links in informational messages
      fix(create-instance): Improve readability of control instance success message
      fix(validate-request): Re-organize validation status to take less vertical space
      fix: Remove redundant comment posted by triggering workflow
      feat: Append instance and volume names to issue description
      feat(validate-request): Simplify status report if all tests pass
```

See MorphoCloud/MorphoCloudWorkflow@605af12...5f1d3ee
  • Loading branch information
jcfr committed Dec 5, 2024
1 parent aeebc3c commit 52a262b
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 54 deletions.
4 changes: 1 addition & 3 deletions .github/actions/control-instance/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@ runs:
body: |
### Command Results ✅
`${{ inputs.command_name }}` command successfully applied to **${{ steps.define.outputs.instance_name }}** instance.
See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Instance **${{ steps.define.outputs.instance_name }}** successfully ${{ inputs.command_name }}d.
- name: Update Request Status Label
uses: ./.github/actions/update-request-status-label
Expand Down
2 changes: 1 addition & 1 deletion .github/instance-creation-progress-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
| :--------------: | :------------------: | :--------------------: | :-----------------: | :-------------------: | :------------------: | :---------------: |
| {{ .create_ip }} | {{ .create_volume }} | {{ .create_instance }} | {{ .associate_ip }} | {{ .setup_instance }} | {{ .attach_volume }} | {{ .send_email }} |

See details at {{ .details_url }}
_See details [here]({{ .details_url }})._
4 changes: 0 additions & 4 deletions .github/workflows/automatic-instance-shelving.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ jobs:
gh workflow run control-instance-from-workflow.yml \
-f issue_number=$issue_number \
-f command_name=shelve
gh issue comment $issue_number \
-b "Workflow **control-instance-from-workflow.yml** triggered by **automatic-instance-shelving.yml** for command <tt>shelve</tt><br> \
<br> \
For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_"
fi
done
env:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/control-instance-from-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ jobs:
- name: Control instance
run: |
gh issue comment $ISSUE_NUMBER \
-b "Command <tt>shelve</tt> issued by **control-instance-from-workflow.yml** workflow<br> \
<br> \
For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_"
-b "Command <tt>shelve</tt> issued by **control-instance-from-workflow.yml** workflow. \
See details [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/create-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ jobs:
Volume **${{ steps.define_volume_name.outputs.volume_name }}** already exists.
See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Create Volume
if: ${{ ! fromJSON(steps.check_volume.outputs.exists) }}
id: create_volume
Expand Down
32 changes: 8 additions & 24 deletions .github/workflows/request-initial-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,18 @@ jobs:
prefix: ${{ vars.INSTANCE_NAME_PREFIX }}
issue_number: ${{ steps.collect_inputs.outputs.issue_number }}

- name: Find Instance Name Comment
uses: peter-evans/find-comment@v3
id: fc_instance_name
- name: description (instance name)
uses: julien-deramond/[email protected]
with:
issue-number: ${{ steps.collect_inputs.outputs.issue_number }}
comment-author: "github-actions[bot]"
body-includes: "### Instance Name"

- name: comment (instance name)
uses: peter-evans/[email protected]
with:
comment-id: ${{ steps.fc_instance_name.outputs.comment-id }}
issue-number: ${{ steps.collect_inputs.outputs.issue_number }}
body: |
### Instance Name
`${{ steps.define.outputs.instance_name }}`
_The instance name is derived from the GitHub issue number using the template `${{ steps.define.outputs.instance_prefix }}instance-NNN`. The instance may also be located in the exosphere interface using this name._
edit-mode: replace
edit-mode: append
append-separator: newline

- name: Define volume name
id: define_volume_name
Expand All @@ -66,26 +58,18 @@ jobs:
issue_number: ${{ steps.collect_inputs.outputs.issue_number }}
suffix: ${{ vars.VOLUME_NAME_SUFFIX }}

- name: Find Volume Name Comment
uses: peter-evans/find-comment@v3
id: fc_volume_name
- name: description (volume name)
uses: julien-deramond/[email protected]
with:
issue-number: ${{ steps.collect_inputs.outputs.issue_number }}
comment-author: "github-actions[bot]"
body-includes: "### Volume Name"

- name: comment (volume name)
uses: peter-evans/[email protected]
with:
comment-id: ${{ steps.fc_volume_name.outputs.comment-id }}
issue-number: ${{ steps.collect_inputs.outputs.issue_number }}
body: |
### Volume Name
`${{ steps.define_volume_name.outputs.volume_name }}`
_The volume name is derived from the GitHub issue number using the template `My-Data-NNN${{ steps.define_volume_name.outputs.volume_suffix }}`. The volume may also be located in the exosphere interface using this name._
edit-mode: replace
edit-mode: append
append-separator: newline

- name: Find Issue Commands Comment
uses: peter-evans/find-comment@v3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/send-email.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,3 @@ jobs:
### Command Results ✅
`email` command successfully completed for **${{ steps.define.outputs.instance_name }}** instance.
See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
5 changes: 2 additions & 3 deletions .github/workflows/update-issue-from-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ jobs:
- name: Add comment
run: |
gh issue comment $ISSUE_NUMBER \
-b "Command <tt>${COMMAND_NAME}</tt> issued by **update-issue-from-workflow.yml** workflow<br> \
<br> \
For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_"
-b "Command <tt>${COMMAND_NAME}</tt> issued by **update-issue-from-workflow.yml** workflow. \
See details [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
Expand Down
39 changes: 27 additions & 12 deletions .github/workflows/validate-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ jobs:
gh workflow run update-issue-from-workflow.yml \
-f issue_number=$ISSUE_NUMBER \
-f command_name=$COMMAND_NAME
gh issue comment $ISSUE_NUMBER \
-b "Workflow **update-issue-from-workflow.yml** triggered by **validate-request.yml** for command <tt>$COMMAND_NAME</tt><br> \
<br> \
For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_"
env:
ISSUE_NUMBER: ${{ steps.collect_inputs.outputs.issue_number }}
COMMAND_NAME: encode_email
Expand All @@ -194,7 +190,29 @@ jobs:
See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: command results comment (status)
if: ${{ success() }}
if:
${{ success() && (steps.check_orcid_format.outputs.valid == 'true' &&
steps.check_email_format.outputs.valid == 'true' &&
steps.check_confirm_email_format.outputs.valid == 'true' &&
steps.check_emails_match.outputs.valid == 'true') }}
uses: peter-evans/[email protected]
with:
issue-number: ${{ steps.collect_inputs.outputs.issue_number }}
body: |
### Validation Results
The validation checks have completed. Below is the status of each check:
| Check | ORCID iD format | Email format | Confirm Email format | Emails match |
| ----------------------- |:----------------------------------------------:|:----------------------------------------------:|:------------------------------------------------------:|:----------------------------------------------:|
| Status | ${{ steps.check_orcid_format.outputs.emojii }} | ${{ steps.check_email_format.outputs.emojii }} | ${{ steps.check_confirm_email_format.outputs.emojii }} | ${{ steps.check_emails_match.outputs.emojii }} |
- name: command results comment (status)
if:
${{ success() && (steps.check_orcid_format.outputs.valid == 'false' ||
steps.check_email_format.outputs.valid == 'false' ||
steps.check_confirm_email_format.outputs.valid == 'false' ||
steps.check_emails_match.outputs.valid == 'false') }}
uses: peter-evans/[email protected]
with:
issue-number: ${{ steps.collect_inputs.outputs.issue_number }}
Expand All @@ -203,12 +221,9 @@ jobs:
The validation checks have completed. Below is the status of each check:
| Check | Status |
| ----------------------- |:-------:|
| ORCID iD format | ${{ steps.check_orcid_format.outputs.emojii }} |
| Email format | ${{ steps.check_email_format.outputs.emojii }} |
| Confirm Email format | ${{ steps.check_confirm_email_format.outputs.emojii }} |
| Emails match | ${{ steps.check_emails_match.outputs.emojii }} | |
| Check | ORCID iD format | Email format | Confirm Email format | Emails match |
| ----------------------- |:----------------------------------------------:|:----------------------------------------------:|:------------------------------------------------------:|:----------------------------------------------:|
| Status | ${{ steps.check_orcid_format.outputs.emojii }} | ${{ steps.check_email_format.outputs.emojii }} | ${{ steps.check_confirm_email_format.outputs.emojii }} | ${{ steps.check_emails_match.outputs.emojii }} |
> [!IMPORTANT]
> If the ORCID iD format is incorrect, edit the issue description to correct it.
Expand All @@ -218,4 +233,4 @@ jobs:
> [!TIP]
> Once the emails are correctly formatted and match, they will be automatically obfuscated for security.
See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
See details [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).

0 comments on commit 52a262b

Please sign in to comment.