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

Add workaround for weird CodeQL releasing schema #72

Open
mirabilos opened this issue Mar 20, 2023 · 3 comments
Open

Add workaround for weird CodeQL releasing schema #72

mirabilos opened this issue Mar 20, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@mirabilos
Copy link

github/codeql-action#1561 (comment) indicates that we shouldn’t look at “releases” for CodeQL.

Could you please add a workaround to the GHA version updater that handles github/codeql-action/* specially?

Thanks!

mirabilos referenced this issue in mirabilos/mksh Mar 26, 2023
mirabilos added a commit to mirabilos/mksh that referenced this issue Mar 26, 2023
mirabilos added a commit to qvest-digital/ECN-Bits that referenced this issue Apr 6, 2023
@mirabilos
Copy link
Author

I put github/codeql-action/init@v2 into the files now, and when I run the updater, it throws an exception (though it’s not clear from the context it’s the codeql one, I just ran the updater on an almost-copy of the .github/workflows/ directory in another repo that had all but the codeql one, and it worked fine):

2023-04-17T02:42:06.7521618Z     return _run_code(code, main_globals, None,
2023-04-17T02:42:06.7521932Z   File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
2023-04-17T02:42:06.7522221Z     exec(code, run_globals)
2023-04-17T02:42:06.7522489Z   File "/app/src/main.py", line 473, in <module>
2023-04-17T02:42:06.7522765Z     actions_version_updater.run()
2023-04-17T02:42:06.7523035Z   File "/app/src/main.py", line 59, in run
2023-04-17T02:42:06.7523296Z     self._update_workflow(workflow_path)
2023-04-17T02:42:06.7523603Z   File "/app/src/main.py", line 149, in _update_workflow
2023-04-17T02:42:06.7523917Z     new_version, new_version_data = self._get_new_version(
2023-04-17T02:42:06.7524233Z   File "/app/src/main.py", line 360, in _get_new_version
2023-04-17T02:42:06.7524547Z     latest_release_data = self._get_latest_version_release(
2023-04-17T02:42:06.7524884Z   File "/app/src/main.py", line 290, in _get_latest_version_release
2023-04-17T02:42:06.7525152Z     latest_release = next(
2023-04-17T02:42:06.7525414Z   File "/app/src/main.py", line 292, in <lambda>
2023-04-17T02:42:06.7525740Z     lambda r: self._release_filter_function(r, parsed_current_version),
2023-04-17T02:42:06.7526069Z   File "/app/src/main.py", line 271, in filter_func
2023-04-17T02:42:06.7526395Z     return any(check(release_tag, current_version) for check in checks)
2023-04-17T02:42:06.7526713Z   File "/app/src/main.py", line 271, in <genexpr>
2023-04-17T02:42:06.7527035Z     return any(check(release_tag, current_version) for check in checks)
2023-04-17T02:42:06.7527344Z   File "/app/src/main.py", line 255, in <lambda>
2023-04-17T02:42:06.7527723Z     checks.append(lambda r, c: parse(r["tag_name"]).major > c.major)
2023-04-17T02:42:06.7528161Z AttributeError: 'LegacyVersion' object has no attribute 'major'

The beginning is cut off, perhaps earlier in the log, but unsure.

@saadmk11
Copy link
Owner

saadmk11 commented Aug 5, 2023

The action now displays warning messages in such cases and will suggest the latest release instead of crashing. You can also skip github/codeql-action/init@v2 update by using ignore option.

@saadmk11 saadmk11 added the bug Something isn't working label Aug 5, 2023
@mirabilos
Copy link
Author

OK, not crashing, and ignoring it is one thing, but maybe have a whitelist of actions for which to not look at the releases but at tags instead would make sense?

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

No branches or pull requests

2 participants