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

fetching releases failed #78

Closed
yarikoptic opened this issue Jun 8, 2021 · 0 comments · Fixed by #79
Closed

fetching releases failed #78

yarikoptic opened this issue Jun 8, 2021 · 0 comments · Fixed by #79
Assignees

Comments

@yarikoptic
Copy link
Member

With the following config

(tinuous-dev) datalad@smaug:/mnt/datasets/datalad/ci/git-annex$ cat config.yml 
repo: datalad/git-annex
vars:
  common_path: 'builds/{year}//{month}//{day}/{type}-{type_id}/{build_commit[:8]}/{wf_name}-{number}-{common_status}/'
ci:
  github:
    path: '{common_path}'
    # place artifacts along with the logs
    artifacts_path: '{common_path}'
    # but releases separately and without subdataset
    releases_path: 'releases/'
    workflows:
    - build-macos.yaml
    - build-ubuntu.yaml
    - build-windows.yaml
since: 2021-04-27T00:00:00Z
types: [cron, pr, push]
datalad:
  enabled: true
  cfg_proc: text2git

eventually tinuous fetch (as of 0.2.0-30-g0215fbb) crashed with

2021-06-08T12:03:28-0400 [INFO    ] tinuous Fetching releases newer than 2021-04-27 00:00:00+00:00
2021-06-08T12:03:28-0400 [INFO    ] tinuous Found release 8.20210310
2021-06-08T12:03:28-0400 [INFO    ] tinuous Found release 8.20210428
Traceback (most recent call last):
  File "/home/datalad/miniconda3/envs/tinuous-dev/bin/tinuous", line 33, in <module>
    sys.exit(load_entry_point('tinuous', 'console_scripts', 'tinuous')())
  File "/home/datalad/miniconda3/envs/tinuous-dev/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/datalad/miniconda3/envs/tinuous-dev/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/datalad/miniconda3/envs/tinuous-dev/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/datalad/miniconda3/envs/tinuous-dev/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/datalad/miniconda3/envs/tinuous-dev/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/datalad/miniconda3/envs/tinuous-dev/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/mnt/datasets/datalad/ci/tinuous/src/tinuous/__main__.py", line 128, in fetch
    path = asset.expand_path(cicfg.releases_path, cfg.vars)
  File "/mnt/datasets/datalad/ci/tinuous/src/tinuous/github.py", line 365, in expand_path
    return expand_template(path_template, self.path_fields(), vars)
  File "/mnt/datasets/datalad/ci/tinuous/src/tinuous/util.py", line 53, in expand_template
    expanded_vars[name] = fstring(tmplt, **fields, **expanded_vars)
  File "/mnt/datasets/datalad/ci/tinuous/src/tinuous/util.py", line 58, in fstring
    return cast(str, eval(f"f{s!r}", {}, kwargs))
  File "<string>", line 1, in <module>
NameError: name 'wf_name' is not defined

seems because we expand all variables unconditionally of either they are used or not in the given path. I guess we could just skip the variables which fail to expand ? (I guess would need at least some .debug level log message to be able to undig that later) or do you see a better way to resolve it @jwodder ?

yarikoptic added a commit that referenced this issue Jun 9, 2021
Don't expand unused vars
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 a pull request may close this issue.

2 participants