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

SSA: Create a new codeql/shared-ssa library pack and move implementation there #10216

Merged
merged 6 commits into from Sep 8, 2022

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Aug 30, 2022

This PR creates a new QL pack for shared, language-agnostic code. I called it codeql/shared-all to be aligned with the names of library packs for our languages, but TBH I don't know why it is called -all and e.g. not -lib.

Update: We decided to use separate packs for separate libraries, so this PR adds a new codeql/shared-ssa pack for the shared SSA library.

The new pack initially consists of the shared SSA implementation, which means that we now only have one (!) copy of that library, as opposed to one per language that uses it.

Commit-by-commit review is suggested.

@hvitved hvitved force-pushed the ssa/shared-lib branch 3 times, most recently from b57f7b1 to b354ad3 Compare August 31, 2022 05:56
@hvitved hvitved marked this pull request as ready for review September 1, 2022 08:49
@hvitved hvitved requested review from a team as code owners September 1, 2022 08:49
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Sep 1, 2022
shared/ssa/qlpack.yml Outdated Show resolved Hide resolved
shared/README.md Outdated Show resolved Hide resolved
@hvitved hvitved changed the title SSA: Create a new shared library pack and move implementation there SSA: Create a new codeql/shared-ssa library pack and move implementation there Sep 2, 2022
cpp/ql/lib/qlpack.yml Outdated Show resolved Hide resolved
shared/ssa/qlpack.yml Show resolved Hide resolved
shared/README.md Outdated Show resolved Hide resolved
aibaars
aibaars approved these changes Sep 5, 2022
Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

This looks good to me. Just a small remark about the "ruby build" workflow.

@@ -95,6 +95,7 @@ jobs:
uses: ./.github/actions/fetch-codeql
- name: Build Query Pack
run: |
codeql pack create ../shared/ssa --output target/packs
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this line necessary? I think the right thing would be to run run codeql pack install ql/lib instead. Although that probably requires codeql/ssa to be published previously, so there might be a bootstrapping problem.

@aeisenberg what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The job fails if I don't add the line.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's leave it in for now. I guess things go wrong at the codeql test run step later in the workflow, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, perhaps we should actually update the qlpack.lock.yml so it includes the new dependency. Perhaps as a follow-up once the shared pack has been published:

codeql pack install ql/lib --mode=update
A fatal error occurred: Package version failure. No compatible version found: codeql/ssa@>=0.0.1 <=0.0.1.

Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

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

😍

Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Looks good to me. Please take note of the manual release process.

@@ -1,4 +1,4 @@
name: codeql/shared-ssa
name: codeql/ssa
version: 0.0.1-dev
Copy link
Contributor

@aeisenberg aeisenberg Sep 6, 2022

Choose a reason for hiding this comment

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

This will have to be manually changed to 0.0.1 before releasing and then manually bumped to 0.0.2 (or whatever) after releasing. We can implement automation for this in a similar way to how we automate the core libraries.

For now, the steps should be:

  1. remove the -dev suffix
  2. commit the change
  3. codeql pack publish
  4. bump the version and add the -dev back
  5. bump all dependencies in the libraries as well
  6. commit the change

This simulates the automation will do. It's important that the git SHA at the time of publishing reflects exactly what is in the package since this SHA is included as metadata in the package and can be used to determine the sources of that package.

@hvitved hvitved merged commit b3653cc into github:main Sep 8, 2022
42 checks passed
@hvitved hvitved deleted the ssa/shared-lib branch September 8, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants