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

Update to latest @pulumi/policy #103

Merged
merged 5 commits into from
Mar 28, 2024
Merged

Update to latest @pulumi/policy #103

merged 5 commits into from
Mar 28, 2024

Conversation

justinvp
Copy link
Member

@justinvp justinvp commented Jan 29, 2024

The @pulumi/policy library was updated to support remediations, but this repo hasn't been updated since then. This commit fixes some compile errors due to the changes there.

$ tsc
enforcementLevel.ts:33:40 - error TS2345: Argument of type '"remediate"' is not assignable to parameter of type 'never'.

33                 return exhaustiveFalse(enforcementLevel);
                                          ~~~~~~~~~~~~~~~~

tests/util.ts:106:31 - error TS2722: Cannot invoke an object which is possibly 'undefined'.

106         await Promise.resolve(validation(args, report));
                                  ~~~~~~~~~~


Found 2 errors.

Note: This points out that we're missing a daily cron in this repro to catch these things sooner. Opened #102

Fixes #101

The `@pulumi/policy` library was updated to support remediations, but this repo hasn't been updated since then. This commit fixes some compile errors due to the changes there.

Note: This points out that we're missing a daily cron in this repro to catch these things sooner.
@justinvp justinvp added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Jan 29, 2024
This allows `yarn run tsc` for the generated test policy pack to succeed (to ensure it compiles). Otherwise, we get compiler errors like:

```
node_modules/@types/node/ts4.8/test.d.ts:881:34 - error TS1005: '?' expected.
```

due to `@types/node` using more recent TypeScript language features than TS 3.8.3.

We shouldn't be relying on the version of TypeScript from `@pulumi/pulumi` anyway. If we're using `tsc`, we should declare our own dev dependency on it.
Otherwise we get an error:

```
* Your query returned no results. Please change your search criteria and try again.
```
@justinvp justinvp merged commit 785cc0f into master Mar 28, 2024
5 checks passed
@justinvp justinvp deleted the justin/fixes branch March 28, 2024 13:52
@justinvp justinvp mentioned this pull request Mar 28, 2024
@t0yv0 t0yv0 changed the title Fix compile errors Update to latest @pulumi/policy May 24, 2024
@t0yv0 t0yv0 mentioned this pull request May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workflow failure: master
2 participants