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

First pass at removing set-output #235

Closed
wants to merge 7 commits into from

Conversation

desrosj
Copy link
Contributor

@desrosj desrosj commented Oct 14, 2022

Work in progress. But feedback is welcome.

Description

set-output has been deprecated. See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/.

Motivation and context

This will remove deprecated notices in workflow summaries.

How has this been tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.

@jrfnl
Copy link
Contributor

jrfnl commented Oct 14, 2022

grin @desrosj Only now seeing your PR, I was working on the same thing ;-)

Copy link
Contributor

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

While I haven't tested this, the code changes look good (save for the composer.lock file changes which need to be undone).

tests/expect/composer.lock Outdated Show resolved Hide resolved
tests/fixtures/with-lock-file/composer.lock Outdated Show resolved Hide resolved
echo "::set-output name=cache-dir::${cache_dir}"
echo "::set-output name=json::${composer_json}"
echo "::set-output name=lock::${composer_lock}"
echo "command=${composer_path}" >> "${GITHUB_OUTPUT}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shellcheck doesn't like this output being called command...

In bin/composer_paths.sh line 56:
echo "command=${composer_path}" >> "${GITHUB_OUTPUT}"
^-- SC2129: Consider using { cmd1; cmd2; } >> file instead of individual redirects.

For more information:
  https://www.shellcheck.net/wiki/SC2129 -- Consider using { cmd1; cmd2; } >>...

Copy link
Contributor Author

@desrosj desrosj Oct 14, 2022

Choose a reason for hiding this comment

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

I've changed the variable name to composer_command.

It doesn't seem like this will have any backwards compatibility concerns since it's only used within the repo. But not sure if I'm missing something.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd need to check, but this output may also be available to steps in external workflows being run after the step using this action runner.
If that's the case and while it would be rare for a workflow to use the command output, it would still need a changelog entry. Though as I said, this would need to be checked and confirmed first.

lock=./composer.lock\n
"

if { $expectedValue != $fileData } {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test fails as it needs to do a regex compare, not a direct comparison.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bash scripting is admittedly poor. Do you have an example I could use as a guide?

Copy link
Contributor

Choose a reason for hiding this comment

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

My bash scripting skills are even worse, then again, my Google skills are reasonable ;-)

lock=\r
"

if { $expectedValue != $fileData } {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test fails as it needs to do a regex compare, not a direct comparison.

lock=../fixtures/with-lock-file/composer.lock\r
"

if { $expectedValue != $fileData } {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test fails as it needs to do a regex compare, not a direct comparison.

lock=../fixtures/out-of-sync-lock/composer.lock\n
"

if { $expectedValue != $fileData } {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test fails as it needs to do a regex compare, not a direct comparison.

lock=./composer.lock\r
"

if { $expectedValue != $fileData } {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test fails as it needs to do a regex compare, not a direct comparison.

\n
"

if { $expectedValue != $fileData } {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test fails as it needs to do a regex compare, not a direct comparison.

@desrosj
Copy link
Contributor Author

desrosj commented Oct 14, 2022

I've addressed a handful of the feedback given. I also added some brief inline documentation to the tests.

@@ -27,5 +33,19 @@ if { $expectedValue != $fileData } {
exit 1
}

# Confirm environment variables.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Confirm environment variables.
# Confirm output variables.

(here and in the other test files)

@jrfnl
Copy link
Contributor

jrfnl commented Oct 22, 2022

@ramsey Would you happen to be able to give some guidance ? Would be nice if the CI related PRs (this one and #237) could get merged soonish, so I can pull the PR for the feature request in #234

@ramsey
Copy link
Owner

ramsey commented Oct 22, 2022

Thank you! I've been away for a bit, but I'll take a look at this today.

@desrosj
Copy link
Contributor Author

desrosj commented Oct 24, 2022

I won't have a chance to circle back to this until Wednesday. @ramsey feel free to make any changes to wrap this up if you'd like to get it out sooner!

@ramsey
Copy link
Owner

ramsey commented Oct 24, 2022

I saw the build errors in #237 but assumed they'd go away when merged into this PR. I'll try to find some time this week to see if I can help resolve things to get this merged and tagged.

Thanks!

@jrfnl
Copy link
Contributor

jrfnl commented Oct 24, 2022

I saw the build errors in #237 but assumed they'd go away when merged into this PR. I'll try to find some time this week to see if I can help resolve things to get this merged and tagged.

They will (should) once the strict comparisons have been changed to regex/wildcard-based comparisons for the tests I flagged up above ;-)

@jrfnl
Copy link
Contributor

jrfnl commented Nov 2, 2022

Anything I can do to help move this forward ?

@desrosj
Copy link
Contributor Author

desrosj commented Nov 3, 2022

Anything I can do to help move this forward ?

I haven't had a chance to circle back to this because of a few other things going on at the moment. I'll likely have time next week, but if you'd like to figure out the needed test adjustments, I'm more than happy to hand the rest of this over to someone else in the interest of seeing this fixed/released.

@jrfnl
Copy link
Contributor

jrfnl commented Nov 3, 2022

Anything I can do to help move this forward ?

I haven't had a chance to circle back to this because of a few other things going on at the moment. I'll likely have time next week, but if you'd like to figure out the needed test adjustments, I'm more than happy to hand the rest of this over to someone else in the interest of seeing this fixed/released.

Okay, so I've just spend a couple of hours trying to get this to work and in the end I ended up in the Tcl manual and it looks like I may have actually managed to get it working... I need to run some more tests to be sure, but I'm hoping to send in a PR later today combining @desrosj commits from this PR with the fix I found.

@jrfnl
Copy link
Contributor

jrfnl commented Nov 3, 2022

Wowie! Tested (including deliberately breaking tests to make sure the solution will correctly fail tests when needed) and I now have a 🟢 build. Will clean up my WIP branch and pull it momentarily.

@jrfnl
Copy link
Contributor

jrfnl commented Nov 3, 2022

I've opened PR #238 which builds onto this one and gets us to a green CI build again.

@ramsey ramsey closed this in #238 Nov 3, 2022
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.

None yet

3 participants