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

Workflow step succeeds, even if octodns-sync fails #40

Closed
solvaholic opened this issue Jan 25, 2021 · 3 comments · Fixed by #45
Closed

Workflow step succeeds, even if octodns-sync fails #40

solvaholic opened this issue Jan 25, 2021 · 3 comments · Fixed by #45
Assignees
Labels
bug Something isn't working

Comments

@solvaholic
Copy link
Owner

Description

From #35 (comment) :

The first thing I noticed was if there are errors running OctoDNS a comment is still left on the pr. I don't think this is really an issue, it's just not what I expected since OctoDNS didn't successfully run. I figured this step would throw an error and the workflow would end here. My initial run had the wrong api credentials which resulted in the following log output:

Traceback (most recent call last):
  File "/usr/local/bin/octodns-sync", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/octodns/cmds/sync.py", line 37, in main
    manager = Manager(args.config_file)
  File "/usr/local/lib/python3.7/site-packages/octodns/manager.py", line 118, in __init__
    self.providers[provider_name] = _class(provider_name, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/octodns/provider/rackspace.py", line 64, in __init__
    auth_token, dns_endpoint = self._get_auth_token(username, api_key)
  File "/usr/local/lib/python3.7/site-packages/octodns/provider/rackspace.py", line 85, in _get_auth_token
    x['name'] == 'cloudDNS'][0]['endpoints'][0]['publicURL']
IndexError: list index out of range

And this is the comment that was left:

github com_paramax_dns_pull_2

Expected Behavior

I figured this step would throw an error and the workflow would end here.

Actual Behavior

if there are errors running OctoDNS a comment is still left on the pr.

Possible Fix

I figured this step would throw an error and the workflow would end here.

Steps to Reproduce

  1. Enable and configure this action
  2. Enable and configure add_pr_comment
  3. Run octodns-sync with invalid credentials

Context

I don't think this is really an issue, it's just not what I expected since OctoDNS didn't successfully run.

Your Environment

  • Version used: main
  • Link to your project:
@solvaholic solvaholic added the bug Something isn't working label Jan 25, 2021
@solvaholic
Copy link
Owner Author

fwiw I suspect this is similar to #23

@solvaholic solvaholic self-assigned this Feb 16, 2021
@solvaholic
Copy link
Owner Author

IndexError: list index out of range

Here's what runs octodns-sync now:

if [ "${_doit}" = "--doit" ]; then
  script "${_logfile}" -e -c \
  "octodns-sync --config-file=\"${_config_path}\" --doit \
  >>\"${_planfile}\""
else
  script "${_logfile}" -e -c \
  "octodns-sync --config-file=\"${_config_path}\" \
  >>\"${_planfile}\""
fi

octodns-sync returns non-zero when it fails, and script -e returns the correct code. entrypoint.sh just doesn't respond to it. I think this should be straightforward, will set up a fix to test.

@solvaholic
Copy link
Owner Author

Got a successful test of this (that is: the step failed) over in:

https://github.com/solvaholic/scaling-succotash/runs/1914410445?check_suite_focus=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant