error messages broken in v0.0.18
Closed this issue · 13 comments
v0.0.18 Github Actions log
2024-03-11T08:52:37.7408030Z ##[group]Run oasdiff/oasdiff-action/breaking@main
2024-03-11T08:52:37.7408818Z with:
2024-03-11T08:52:37.7409271Z base: https://<hostname>/api-docs/v4/api.yaml
2024-03-11T08:52:37.7409896Z revision: public/api-docs/v4/api.yaml
2024-03-11T08:52:37.7410381Z fail-on-diff: true
2024-03-11T08:52:37.7410747Z include-path-params: false
2024-03-11T08:52:37.7411476Z composed: false
2024-03-11T08:52:37.7412136Z ##[endgroup]
2024-03-11T08:52:37.7743142Z ##[command]/usr/bin/docker run --name c9619df23929694ff45629b34a89e2c750a48_3fda30 --label 3c9619 --workdir /github/workspace --rm -e "INPUT_BASE" -e "INPUT_REVISION" -e "INPUT_FAIL-ON-DIFF" -e "INPUT_INCLUDE-CHECKS" -e "INPUT_INCLUDE-PATH-PARAMS" -e "INPUT_DEPRECATION-DAYS-BETA" -e "INPUT_DEPRECATION-DAYS-STABLE" -e "INPUT_EXCLUDE-ELEMENTS" -e "INPUT_COMPOSED" -e "INPUT_OUTPUT-TO-FILE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/<repo>/<repo>":"/github/workspace" 3c9619:df23929694ff45629b34a89e2c750a48 "https://<hostname>/api-docs/v4/api.yaml" "public/api-docs/v4/api.yaml" "true" "" "false" "" "" "" "false" ""
2024-03-11T08:52:38.3154858Z running oasdiff breaking... base: https://<hostname>/api-docs/v4/api.yaml, revision: public/api-docs/v4/api.yaml, fail_on_diff: true, include_checks: , include_path_params: false, deprecation_days_beta: , deprecation_days_stable: , exclude_elements: , composed: false, output_to_file:
2024-03-11T08:52:38.3170224Z flags: --fail-on WARN
2024-03-11T08:52:40.5964966Z ##[error]Unable to process file command 'output' successfully.
2024-03-11T08:52:40.5983453Z ##[error]Invalid value. Matching delimiter not found '294217520dd1492ebded706d03a4add0'
v0.0.16 works fine.
2024-03-11T09:04:36.3778499Z ##[group]Run oasdiff/oasdiff-action/breaking@v0.0.16
2024-03-11T09:04:36.3779388Z with:
2024-03-11T09:04:36.3780117Z base: https://<hostname>/api-docs/v4/api.yaml
2024-03-11T09:04:36.3781135Z revision: public/api-docs/v4/api.yaml
2024-03-11T09:04:36.3781925Z fail-on-diff: true
2024-03-11T09:04:36.3782512Z include-path-params: false
2024-03-11T09:04:36.3783117Z ##[endgroup]
2024-03-11T09:04:36.4134887Z ##[command]/usr/bin/docker run --name f20768f515724e6648b5a071c71064d81d75_764c82 --label 20f207 --workdir /github/workspace --rm -e "INPUT_BASE" -e "INPUT_REVISION" -e "INPUT_FAIL-ON-DIFF" -e "INPUT_INCLUDE-CHECKS" -e "INPUT_INCLUDE-PATH-PARAMS" -e "INPUT_DEPRECATION-DAYS-BETA" -e "INPUT_DEPRECATION-DAYS-STABLE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/<repo>/<repo>":"/github/workspace" 20f207:68f515724e6648b5a071c71064d81d75 "https://<hostname>/api-docs/v4/api.yaml" "public/api-docs/v4/api.yaml" "true" "" "false" "" ""
2024-03-11T09:04:36.8785035Z running oasdiff breaking... base: https://<hostname>/api-docs/v4/api.yaml, revision: public/api-docs/v4/api.yaml, fail_on_diff: true, include_checks: , include_path_params: false, deprecation_days_beta: , deprecation_days_stable:
2024-03-11T09:04:36.8821578Z flags: --fail-on WARN
2024-03-11T09:04:40.0841612Z ##[error]in API POST ... the request property '...' became required
<snip>
2024-03-11T09:04:40.1001376Z ##[warning]in API POST ... removed the request property '...'
<snip>
2024-03-11T09:04:40.1080034Z
2024-03-11T09:04:40.2520210Z Post job cleanup.
Thanks, @SCjona.
I notice that the tests do not reproduce the issue. Could you please write a test to reproduce it, or provide the necessary data for us to do so?
I also invite you to join our community on Slack so we can discuss it offline if you prefer.
https://join.slack.com/t/oasdiff/shared_invite/zt-2dnb1y9h1-1CvnjRzSGCfCQAr30BlEzQ
This is a minimal reproducible example:
https://github.com/SCjona/oasdiff-test/
https://github.com/SCjona/oasdiff-test/pull/1
Hello @effoeffi, I tried your fix https://github.com/SCjona/oasdiff-test/pull/1/commits/9f41e7d2e340c92e4692e59554ae8003e0430e1c but now it seems like there is just no output at all. https://github.com/SCjona/oasdiff-test/actions/runs/8232531541/job/22510167805?pr=1
I'll invite you as maintainer to the repo so you can rerun the action as needed.
@SCjona, the GitHub Actions' behavior seems odd.
Could you please take a look and confirm if everything appears to be in order now?
sadly the issue persists. ran it with debug logs once
##[debug]Evaluating condition for step: 'Checking OpenAPI Spec changes'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Checking OpenAPI Spec changes
##[debug]Loading inputs
##[debug]Loading env
Run oasdiff/oasdiff-action/breaking@issue46
##[debug]Evaluating: inputs.base
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'base'
##[debug]=> 'petstore-current.yaml'
##[debug]Result: 'petstore-current.yaml'
##[debug]Evaluating: inputs.revision
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'revision'
##[debug]=> 'petstore-updated.yaml'
##[debug]Result: 'petstore-updated.yaml'
##[debug]Evaluating: inputs.fail-on-diff
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'fail-on-diff'
##[debug]=> 'true'
##[debug]Result: 'true'
##[debug]Evaluating: inputs.include-checks
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'include-checks'
##[debug]=> ''
##[debug]Result: ''
##[debug]Evaluating: inputs.include-path-params
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'include-path-params'
##[debug]=> 'false'
##[debug]Result: 'false'
##[debug]Evaluating: inputs.deprecation-days-beta
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'deprecation-days-beta'
##[debug]=> ''
##[debug]Result: ''
##[debug]Evaluating: inputs.deprecation-days-stable
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'deprecation-days-stable'
##[debug]=> ''
##[debug]Result: ''
##[debug]Evaluating: inputs.exclude-elements
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'exclude-elements'
##[debug]=> ''
##[debug]Result: ''
##[debug]Evaluating: inputs.composed
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'composed'
##[debug]=> 'false'
##[debug]Result: 'false'
##[debug]Evaluating: inputs.output-to-file
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'output-to-file'
##[debug]=> ''
##[debug]Result: ''
/usr/bin/docker run --name a332c87e7a680eb4c5eb9727373f76d3948_7cbcba --label 548a33 --workdir /github/workspace --rm -e "INPUT_BASE" -e "INPUT_REVISION" -e "INPUT_FAIL-ON-DIFF" -e "INPUT_INCLUDE-CHECKS" -e "INPUT_INCLUDE-PATH-PARAMS" -e "INPUT_DEPRECATION-DAYS-BETA" -e "INPUT_DEPRECATION-DAYS-STABLE" -e "INPUT_EXCLUDE-ELEMENTS" -e "INPUT_COMPOSED" -e "INPUT_OUTPUT-TO-FILE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACT
running oasdiff breaking... base: petstore-current.yaml, revision: petstore-updated.yaml, fail_on_diff: true, include_checks: , include_path_params: false, deprecation_days_beta: , deprecation_days_stable: , exclude_elements: , composed: false, output_to_file:
flags: --fail-on WARN
##[debug]Docker Action run completed with exit code 1
##[debug]Finishing: Checking OpenAPI Spec changes
I analyzed the entrypoint.sh of breaking in v0.0.18 using shellcheck. i think the file output stuff is what broke it
In entrypoint.sh line 5:
local output="$1"
^----------^ SC3043 (warning): In POSIX sh, 'local' is undefined.
In entrypoint.sh line 7:
local file_output="$2"
^---------------^ SC3043 (warning): In POSIX sh, 'local' is undefined.
In entrypoint.sh line 15:
size=$(echo "$output" | wc -c)
^--------------------^ SC2000 (style): See if you can use ${#variable} instead.
In entrypoint.sh line 68:
delimiter=$(cat /proc/sys/kernel/random/uuid | tr -d '-')
^--------------------------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
In entrypoint.sh line 72:
output=$(oasdiff breaking "$base" "$revision" $flags)
^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
output=$(oasdiff breaking "$base" "$revision" "$flags")
In entrypoint.sh line 90:
oasdiff breaking "$base" "$revision" $flags
^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
oasdiff breaking "$base" "$revision" "$flags"
For more information:
https://www.shellcheck.net/wiki/SC3043 -- In POSIX sh, 'local' is undefined.
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
https://www.shellcheck.net/wiki/SC2000 -- See if you can use ${#variable} i...
note: not everything this tool reports is supposed to be fixed
nvm this seems to be the issue
write_output "$(echo "$output" | head -n 1)" "$output"
the first param is the content, the second is the output to send to the output file if specified. in my case i dont output to a file so i just get the head | -n 1
output part
https://www.shellcheck.net/wiki/SC3043 -- In POSIX sh, 'local' is undefined.
I think this is the issue, and I follow this for the fix.
Please validate.
still not fixed... i think i know what's wrong tho I'll try to fix it myself and make a PR