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 — Set up the Swift version the extractor declares by angelapwen · Pull Request #1422 · github/codeql-action

Conversation

@angelapwen

@angelapwen angelapwen commented Dec 8, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

This PR changes the setup-swift Action to set up the version of Swift the extractor declares (except on Windows). It also adds the nightly-latest PR check back to a couple of PR checks, which were removed in #1412 to unblock the release.

Note that after this PR merges, we should remember to update the corresponding integration test within the CLI, and include the bumped setup-swift SHA (#1415) as well.

When the newest version of the CLI (that supports 5.7.1) makes it to latest and cached, we should be able to remove this logic and unconditionally setup 5.7.1, as future versions of the extractor should maintain backwards compatibility with prior Swift versions.

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
@angelapwen
Unconditionally setup Swift 5.7.1
2474e31
@angelapwen

angelapwen commented Dec 8, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

cached and latest are failing (expected as they only support 5.7.0 and not 5.7.1).

I can conditionally setup 5.7.0 for latest, or we could wait to merge this PR until latest and cached reflect the last release which should support 5.7.1 🤔 (but this would mean that we're not testing nightly-latest until then).

All reactions

Sorry, something went wrong.

Uh oh!

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

@angelapwen
angelapwen marked this pull request as ready for review December 8, 2022 15:20
@angelapwen
angelapwen requested a review from a team as a code owner December 8, 2022 15:20
@henrymercer

henrymercer commented Dec 8, 2022

Copy link
Copy Markdown
Contributor

For cached to reflect the latest release, we'd need to wait another 2 weeks or so.

I think perhaps while Swift is in beta, we should just test that the Swift extractor is compatible with the Swift version it declares:

codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }'

This mimics the internal tests, and while it's further away from customer setups, it avoids us having to update these tests every release while Swift is in beta.

angelapwen 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.

@angelapwen
Set up Swift version from extractor
4d8bc9a
@angelapwen angelapwen changed the title Unconditionally setup Swift 5.7.1 Set up the Swift version the extractor declares Dec 8, 2022
@angelapwen

angelapwen commented Dec 8, 2022

Copy link
Copy Markdown
Contributor Author

For cached to reflect the latest release, we'd need to wait another 2 weeks or so.

I think perhaps while Swift is in beta, we should just test that the Swift extractor is compatible with the Swift version it declares:

codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }'

This mimics the internal tests, and while it's further away from customer setups, it avoids us having to update these tests every release while Swift is in beta.

Oh, that's a nice workaround. Updated 👍 (although I guess the internal tests should also be testing prior versions of Swift to catch problems similar to the one we just encountered)

All reactions

Sorry, something went wrong.

Uh oh!

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

@henrymercer

henrymercer commented Dec 8, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Ah, that approach isn't very easy because we need to setup Swift before running codeql-action/init, but at that point CodeQL hasn't been downloaded yet, so we can't get the Swift version from the CodeQL distribution.

In that case, we might have to stop running this test on cached due to the bumpiness of which CodeQL version the cache contains, and manually specify which Swift versions correspond to each bundle.

Optionally, we could define a top-level setup-swift boolean in each generated workflow definition, and update sync.py to add the appropriate setup step to the Action.

All reactions

Sorry, something went wrong.

Uh oh!

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

@angelapwen
Always setup 5.7.1, stop testing cached for Swift
50fd9ed
@angelapwen

angelapwen commented Dec 15, 2022

Copy link
Copy Markdown
Contributor Author

I've updated all 4 Swift-related PR checks to use 5.7.1, and stopped testing cached where I could but running into a couple issues:

  • Swift analysis using a custom build command on latest is failing because the latest version of CLI still is the version that requires 5.7.0 and not 5.7.1. This should cease to be an issue once our newest version goes into latest (and afterwards as well, as long as the extractor continues to support 5.7.1).
  • The multi-language autodetect check is failing on cached (and presumably latest) — even though I am no longer checking for the Swift database, it's still attempting to extract Swift because it's been automatically detected in the repository. I can't specify the languages to check because that defeats the purpose of this PR check (the autodetect).

Is it a viable solution to just wait until the newest CLI version that supports 5.7.1 makes it into latest and cached, and then merge this PR? It doesn't solve the longer-term problem of extractors not providing backwards compatibility with prior Swift versions, but hopefully this is not a common occurrence even in beta, and ideally should be tested in the CLI.

All reactions

Sorry, something went wrong.

Uh oh!

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

@angelapwen

angelapwen commented Dec 15, 2022

Copy link
Copy Markdown
Contributor Author

Aditya suggested checking the Swift version from the extractor after the init step as a stopgap until the newest CLI makes it to latest. Will give that a try now.

All reactions

Sorry, something went wrong.

Uh oh!

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

@angelapwen
Set up Swift version extractor declares after init
31aec7e
@angelapwen

angelapwen commented Dec 15, 2022

Copy link
Copy Markdown
Contributor Author

I think the above approach should work, but we are still getting this error — 

/home/runner/work/_temp/4bebb1c6-be8f-43cf-9dfd-75dc640e9229.sh: line 1: codeql/experimental/swift/tools/*/extractor: No such file or directory

Is this perhaps the wrong path, or has the extractor been cleaned up after the init step?

All reactions

Sorry, something went wrong.

Uh oh!

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

@angelapwen
angelapwen force-pushed the swift-5.7.1 branch 3 times, most recently from 9c925fc to 2c0ca85 Compare December 16, 2022 01:19
@angelapwen
Update CodeQL Path in PR checks
20b2d99
@angelapwen
angelapwen force-pushed the swift-5.7.1 branch from 2c0ca85 to 20b2d99 Compare December 16, 2022 01:21
angelapwen added 4 commits December 15, 2022 17:24
@angelapwen
Replace checks for cached
bf7b57a
@angelapwen
Update variable assignment
f98790d
@angelapwen
Set Swift env variable globally
ae01aeb
@angelapwen
Test resolve languages command
bf101af
@angelapwen
angelapwen force-pushed the swift-5.7.1 branch 4 times, most recently from 8531eee to 3c9bc73 Compare December 16, 2022 17:58
@angelapwen
Simply print the Swift extractor dir
8abe7d8
@angelapwen
angelapwen force-pushed the swift-5.7.1 branch 2 times, most recently from 79f629c to 4f1c8c5 Compare December 16, 2022 21:48
@henrymercer

henrymercer commented Dec 19, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

😮‍💨 I had an error that the new setup-swift step couldn't be found without running checkout, so I ran it again just before setup-swift but this overwrote the whole directory (I think). Reverted and trying to figure out why setup-swift can't be found when the checkout Action is run at the beginning of each check. But hit API rate limits again 🕐

Hmm, this is a little annoying. I think the problem is that the prepare-test step moves everything in the CodeQL Action repo apart from the multi-language test repository into action:

Run mkdir ../action
  mkdir ../action
  mv * .github ../action/
  mv ../action/tests/multi-language-repo/{*,.github} .
  mv ../action/.github/workflows .github

I expect that if we replace the call by ../action/.github/setup-swift then that should work.

angelapwen 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.

@angelapwen
Use proper file path for setup swift
bfbd05f
@angelapwen

angelapwen commented Dec 19, 2022

Copy link
Copy Markdown
Contributor Author

Hmm, this is a little annoying. I think the problem is that the prepare-test step moves everything in the CodeQL Action repo apart from the multi-language test repository into action:

Run mkdir ../action
  mkdir ../action
  mv * .github ../action/
  mv ../action/tests/multi-language-repo/{*,.github} .
  mv ../action/.github/workflows .github

I expect that if we replace the call by ../action/.github/setup-swift then that should work.

Thank you — that did it! That makes sense 😸

All reactions

Sorry, something went wrong.

Uh oh!

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

@angelapwen
angelapwen requested review from adityasharad and henrymercer December 19, 2022 18:17
adityasharad
adityasharad previously approved these changes Dec 19, 2022
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.

Looks sensible, good work! Minor Bash suggestions.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread .github/setup-swift/action.yml Resolved

Uh oh!

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

@angelapwen @adityasharad
Update .github/setup-swift/action.yml
609cafe
Co-authored-by: Aditya Sharad <[email protected]>
@angelapwen
angelapwen dismissed adityasharad’s stale review via 609cafe December 19, 2022 18:30
@angelapwen
angelapwen requested a review from adityasharad December 19, 2022 18:30
adityasharad
adityasharad previously approved these changes Dec 19, 2022
View reviewed changes
@angelapwen
angelapwen enabled auto-merge (squash) December 19, 2022 18:33
@angelapwen

angelapwen commented Dec 19, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

Hm... the PR checks I changed don't seem to have run anymore. I'll close and reopen to see if this triggers them.

EDIT: Could be that the file path should be ./../action/.github/setup-swift rather than ../action/.github/setup-swift? Not sure why that would prevent the checks from running at all, but have updated for consistency.

All reactions

Sorry, something went wrong.

Uh oh!

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

@angelapwen angelapwen closed this Dec 19, 2022
auto-merge was automatically disabled December 19, 2022 20:00

Pull request was closed

@angelapwen angelapwen reopened this Dec 19, 2022
@angelapwen
Update file path for setup-swift
e49ccec
@angelapwen
angelapwen dismissed adityasharad’s stale review via e49ccec December 19, 2022 20:02
@angelapwen

angelapwen commented Dec 19, 2022

Copy link
Copy Markdown
Contributor Author

Ok.. that seems to have done it 😆 re-requesting review (again), sorry!

All reactions

Sorry, something went wrong.

Uh oh!

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

@angelapwen
angelapwen requested a review from adityasharad December 19, 2022 20:16
@angelapwen
angelapwen enabled auto-merge (squash) December 19, 2022 20:43
adityasharad
adityasharad approved these changes Dec 19, 2022
View reviewed changes
@angelapwen
angelapwen merged commit 4778dfb into github:main Dec 19, 2022
This was referenced Jan 12, 2023
Merge main into releases/v2 #1476
Merged
Merge releases/v2 into releases/v1 #1478
Merged
This was referenced Nov 29, 2023
[Snyk] Fix for 7 vulnerabilities aliscco/codeql-action#921
Open
[Snyk] Security upgrade semantic-release from 15.14.0 to 17.0.1 aliscco/codeql-action#932
Open
[Snyk] Security upgrade semantic-release from 15.14.0 to 17.0.1 aliscco/codeql-action#975
Open
[Snyk] Fix for 1 vulnerabilities aliscco/codeql-action#1126
Open
[Snyk] Fix for 1 vulnerabilities aliscco/codeql-action#1158
Open
[Snyk] Fix for 1 vulnerabilities aliscco/codeql-action#1211
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adityasharad adityasharad adityasharad approved these changes
@henrymercer henrymercer Awaiting requested review from henrymercer

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.

3 participants

@angelapwen @henrymercer @adityasharad
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.