GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add a fix for python 3.12 by aeisenberg · Pull Request #1928 · github/codeql-action

Conversation

@aeisenberg

@aeisenberg aeisenberg commented Oct 6, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The python extractor does not yet support 3.12. Check for this and instead make sure we run python 3.11. Only need to check on windows since we are extremely unlikely to be running 3.12 on linux or macos.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aeisenberg
Add a fix for python 3.12
d091652
The python extractor does not yet support 3.12. Check for this and
instead make sure we run python 3.11. Only need to check on windows
since we are extremely unlikely to be running 3.12 on linux or macos.
@aeisenberg
aeisenberg requested review from a team as code owners October 6, 2023 20:07
adityasharad
adityasharad reviewed Oct 6, 2023
View reviewed changes

@adityasharad adityasharad left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Clever. Looks reasonable.
Can we have an integration test on Windows that calls setup-python with 3.12 to exercise this path?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread python-setup/check_python12.ps1 Outdated
Write-Host "Python 3.11 detected, using this version instead of 3.12+."
Write-Output "PY_PYTHON3=3.11" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
} else {
Write-Host "FAILURE: Python 3.12+ is not supported. Please install Python 3.11."

@adityasharad adityasharad Oct 6, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Optional.

Suggested change
Write-Host "FAILURE: Python 3.12+ is not supported. Please install Python 3.11."
Write-Host "FAILURE: Python 3.12+ is not supported, and Python 3.11 could not be detected on the system. Please install Python 3.11."

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aeisenberg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
angelapwen
angelapwen reviewed Oct 6, 2023
View reviewed changes
Comment thread python-setup/check_python12.ps1
#! /usr/bin/pwsh

# If we are running greater than or equal to python 3.12, change py to run version 3.11
Write-Host "Checking python version"

@angelapwen angelapwen Oct 6, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
Write-Host "Checking python version"
Write-Host "Checking Python version"

Super-nit

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@aeisenberg aeisenberg Oct 6, 2023

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Actually, I think all Python should be python.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

angelapwen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@aeisenberg

aeisenberg commented Oct 6, 2023

Copy link
Copy Markdown
Contributor Author

Should be simple enough to create a test.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg
aeisenberg requested review from adityasharad and angelapwen October 6, 2023 20:50
@aeisenberg
Add integration test
028bacb
Also:

- Update changelog
- Fix comments in check_python script
@aeisenberg
aeisenberg force-pushed the aeisenberg/fix-python312 branch from 9ebed2f to 028bacb Compare October 6, 2023 20:52
@criemen

criemen commented Oct 6, 2023

Copy link
Copy Markdown
Contributor

I think we should query a feature flag from the CLI so that we can turn off this workaround from within the CLI once we've a release out that fixes the python extractor.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg

aeisenberg commented Oct 6, 2023

Copy link
Copy Markdown
Contributor Author

Good call. I can check for less than 2.15.0.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@criemen

criemen commented Oct 6, 2023

Copy link
Copy Markdown
Contributor

I think the new tool-features feature (see https://github.com/github/codeql-action/pull/1909/files#diff-a2b4f46aa09bd648db18893b59331e2e037dfb60954c80383d820703b09d2519) would be more appropriate to use.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg

aeisenberg commented Oct 6, 2023

Copy link
Copy Markdown
Contributor Author

That requires adding the feature to the CLI directly, no?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@criemen

criemen commented Oct 6, 2023

Copy link
Copy Markdown
Contributor

As far as I understand it yes, but only once we're actually shipping new python-3.12 support - which should be doable, as we release the python extractor together with the CLI.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg

aeisenberg commented Oct 6, 2023

Copy link
Copy Markdown
Contributor Author

Ah...I see what you're saying. I choose a feature name now and that will be the feature name in the version of codeql that has the fix. Good idea.

criemen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-advanced-security

github-advanced-security AI commented Oct 6, 2023

Copy link
Copy Markdown
Contributor

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg
aeisenberg force-pushed the aeisenberg/fix-python312 branch from bd30ad1 to 8a81c5b Compare October 6, 2023 21:12
@aeisenberg
Add a feature flag to turn this off for newer versions of codeql
669c610
@aeisenberg
aeisenberg force-pushed the aeisenberg/fix-python312 branch from 8a81c5b to 669c610 Compare October 6, 2023 21:17
angelapwen
angelapwen reviewed Oct 6, 2023
View reviewed changes
Comment thread CHANGELOG.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

angelapwen
angelapwen previously approved these changes Oct 6, 2023
View reviewed changes

@angelapwen angelapwen left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good modulo question on the changelog file!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aeisenberg
Update CHANGELOG.md
94b6970
@aeisenberg
aeisenberg dismissed angelapwen’s stale review via 94b6970 October 6, 2023 21:49
@aeisenberg
aeisenberg enabled auto-merge October 6, 2023 21:49
angelapwen
angelapwen approved these changes Oct 6, 2023
View reviewed changes
angelapwen
angelapwen reviewed Oct 6, 2023
View reviewed changes
Comment thread CHANGELOG.md
## [UNRELEASED]

No user facing changes.
- Add a workaround python 3.12, which is not supported in CodeQL CLI version 2.14.6 or earlier. If you are running an analysis on Windows and using python 3.12 or later, the CodeQL Action will switch to running python 3.11. If python 3.11 is not found, then the workflow will fail.

@angelapwen angelapwen Oct 6, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
- Add a workaround python 3.12, which is not supported in CodeQL CLI version 2.14.6 or earlier. If you are running an analysis on Windows and using python 3.12 or later, the CodeQL Action will switch to running python 3.11. If python 3.11 is not found, then the workflow will fail.
- Add a workaround for python 3.12, which is not supported in CodeQL CLI version 2.14.6 or earlier. If you are running an analysis on Windows and using python 3.12 or later, the CodeQL Action will switch to running python 3.11. If python 3.11 is not found in this case, then the workflow will fail.

Just realized it's missing a word..

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@aeisenberg aeisenberg Oct 6, 2023

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks I'll put this in a follow-up.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@angelapwen
angelapwen disabled auto-merge October 6, 2023 22:32
@aeisenberg
aeisenberg enabled auto-merge October 6, 2023 22:34
@aeisenberg
aeisenberg merged commit 0d5c2e0 into main Oct 6, 2023
@aeisenberg
aeisenberg deleted the aeisenberg/fix-python312 branch October 6, 2023 23:42
@aeisenberg aeisenberg mentioned this pull request Oct 7, 2023
Update CHANGELOG.md #1930
Merged
@github-actions github-actions Bot mentioned this pull request Oct 9, 2023
Merge main into releases/v2 #1932
Merged
6 tasks
@aeisenberg aeisenberg mentioned this pull request Nov 10, 2023
Fix failing workflows #1984
Merged
3 tasks
@angelapwen angelapwen mentioned this pull request Mar 11, 2024
Update default bundle to 2.16.4 #2185
Merged
brumboy59
brumboy59 approved these changes Feb 18, 2025
View reviewed changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adityasharad adityasharad Awaiting requested review from adityasharad
2 more reviewers
@angelapwen angelapwen angelapwen approved these changes
@brumboy59 brumboy59 brumboy59 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@aeisenberg @criemen @github-advanced-security @adityasharad @angelapwen @brumboy59
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.