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

Fail analyze step in PR check by passing an invalid option to database finalize #2189

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

angelapwen
Copy link
Contributor

@angelapwen angelapwen commented Mar 8, 2024

The ram: 1 trick won't work anymore with recent updates to the CLI, so we need to find an alternate way to fail the analyze step here.

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.

@angelapwen angelapwen changed the title Fail analyze step by deleting .rel files Fail analyze step in PR check by deleting .rel files Mar 8, 2024
@angelapwen angelapwen force-pushed the angelapwen/fix-debug-artifacts-failure branch 28 times, most recently from 93f5cce to 7fc2d51 Compare March 8, 2024 23:45
@angelapwen angelapwen changed the title Fail analyze step in PR check by deleting .rel files Fail analyze step in PR check by passing an invalid option to database finalize Mar 8, 2024
@angelapwen angelapwen force-pushed the angelapwen/fix-debug-artifacts-failure branch from 7fc2d51 to 8b44fe3 Compare March 8, 2024 23:50
@angelapwen angelapwen marked this pull request as ready for review March 8, 2024 23:56
@angelapwen angelapwen requested a review from a team as a code owner March 8, 2024 23:56
@angelapwen
Copy link
Contributor Author

setup-swift failures are upstream failures (swift-actions/setup-swift#666). Hopefully, these are resolved soon — otherwise maybe I'll have to make those checks non-required so I can get this in to unblock #2185.

adityasharad
adityasharad previously approved these changes Mar 9, 2024
@@ -50,9 +50,11 @@ jobs:
run: ./build.sh
- uses: ./../action/analyze
id: analysis
env:
# Forces a failure in this step.
CODEQL_ACTION_EXTRA_OPTIONS: "{ \"database\": { \"finalize\": [\"--invalid-option\"] } }"
Copy link
Contributor

Choose a reason for hiding this comment

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

Observation: This tests the case where database finalize fails and we want to check we have debug artifacts. It doesn't test the case where database run-queries or database interpret-results fails and similarly we want to check debug artifacts. That is okay for now, but we may want to expand the test in future to tamper with each of these commands separately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I think you could have gotten away without the \" escaping by using single quotes to enclose the entire string. See https://github.com/search?type=code&q=CODEQL_ACTION_EXTRA_OPTIONS for some examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Ah! I didn't think to search in the entire org (only searched in this repo). I'll update to single quotes to make it more readable.

As the `ram: 1` trick won't work anymore with updates to the CLI.
@angelapwen angelapwen force-pushed the angelapwen/fix-debug-artifacts-failure branch from 8b44fe3 to d7fca36 Compare March 9, 2024 01:37
@angelapwen angelapwen merged commit 532ca54 into main Mar 11, 2024
297 checks passed
@angelapwen angelapwen deleted the angelapwen/fix-debug-artifacts-failure branch March 11, 2024 13:57
@github-actions github-actions bot mentioned this pull request Mar 12, 2024
8 tasks
angelapwen added a commit that referenced this pull request Mar 12, 2024
* Update changelog and version after v3.24.6

* Update checked-in dependencies

* Bump the npm group with 3 updates (#2183)

* Bump the npm group with 3 updates

Bumps the npm group with 3 updates: [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser), [eslint-plugin-github](https://github.com/github/eslint-plugin-github) and [nock](https://github.com/nock/nock).


Updates `@typescript-eslint/parser` from 7.1.0 to 7.1.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.1.1/packages/parser)

Updates `eslint-plugin-github` from 4.10.1 to 4.10.2
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](github/eslint-plugin-github@v4.10.1...v4.10.2)

Updates `nock` from 13.5.3 to 13.5.4
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](nock/nock@v13.5.3...v13.5.4)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: eslint-plugin-github
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: nock
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update supported GitHub Enterprise Server versions

* Update `languages` help

Recommend using a matrix build

* Remove experimental qualifiers from build mode input

* Escape named value in input description

* Fail `analyze` step by passing an invalid option to `database finalize` (#2189)

As the `ram: 1` trick won't work anymore with updates to the CLI.

* Update default bundle to 2.16.4 (#2185)

* Update default bundle to codeql-bundle-v2.16.4

* Add changelog note

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Angela P Wen <angelapwen@github.com>

* Use the `--sarif-include-query-help` option when supported

* Bump the npm group with 2 updates (#2190)

* Bump the npm group with 2 updates

Bumps the npm group with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [typescript](https://github.com/Microsoft/TypeScript).


Updates `@typescript-eslint/eslint-plugin` from 7.1.0 to 7.1.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.1.1/packages/eslint-plugin)

Updates `typescript` from 5.3.3 to 5.4.2
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](microsoft/TypeScript@v5.3.3...v5.4.2)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Rebuild sources

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>

* Update changelog for v3.24.7

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Angela P Wen <angelapwen@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Henry Mercer <henrymercer@github.com>
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
@github-actions github-actions bot mentioned this pull request Mar 12, 2024
8 tasks
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 this pull request may close these issues.

2 participants