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

feat: update policy loading to reflect Oso 0.20.1 changes #259

Merged
merged 2 commits into from
Sep 22, 2021
Merged

feat: update policy loading to reflect Oso 0.20.1 changes #259

merged 2 commits into from
Sep 22, 2021

Conversation

bartosjiri
Copy link
Contributor

An attempt to resolve #258.

A few comments, mostly due to my lack of experience:

  • As discussed, left the loadFile option in for backwards compatibility, however do not have any experience with typedoc so the proposed reference is not provided
  • Updated dependencies and peerDependencies to [email protected] or higher
  • Updated tests to include various cases of both deprecated loadFile and loadFiles options
  • Kept fast-glob dependency, because was unsure how path wildcards can be used in Oso

Please suggest changes/improvements or directly implement edits. Thank you!

src/oso.module.ts Outdated Show resolved Hide resolved
Copy link
Member

@simenandre simenandre left a comment

Choose a reason for hiding this comment

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

Thanks again! It looks good, left some nitpicking!

}

if (this.options.loadStr) {
await this.loadStr(this.options.loadStr);
}
}

private async loadFiles(patterns: string[]): Promise<void> {
private async _loadFiles(patterns: string[]): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

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

Why are you adding an underscore here?

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 loadFiles method is from Polar's Polar.loadFiles, but does not load path wildcards, from what I understood. The _loadFiles without the underscore uses fast-glob to provide solution to this, but can be also renamed. Am I correct or missing something?

@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #259 (5f41d8f) into main (9d911a3) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 5f41d8f differs from pull request most recent head 3f596db. Consider uploading reports for the commit 3f596db to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##              main      #259   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines           40        43    +3     
  Branches         4         5    +1     
=========================================
+ Hits            40        43    +3     
Impacted Files Coverage Δ
src/oso.module.ts 100.00% <ø> (ø)
src/oso.service.ts 100.00% <100.00%> (ø)
src/oso-metadata.storage.ts 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a11e0d...3f596db. Read the comment docs.

Co-authored-by: Simen A. W. Olsen <[email protected]>
@simenandre simenandre merged commit a45084c into bjerkio:main Sep 22, 2021
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.

Oso ^0.20.1 breaking changes support
2 participants