-
Notifications
You must be signed in to change notification settings - Fork 25
Add CI-ready entitlement smart diff #74
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
base: main
Are you sure you want to change the base?
Changes from all commits
1b0223f
533dec9
301e99d
91a5c4a
77e8e53
3214867
b950461
6376bb4
d29f4f9
671fbeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/usr/bin/env ruby | ||
|
|
||
| require "entitlements" | ||
| require "entitlements/smart_diff/cli" | ||
|
|
||
| exit Entitlements::SmartDiff::Cli.run |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,10 +21,12 @@ class Text < Entitlements::Data::Groups::Calculated::Base | |
| # Returns a Set[String] with DN's of the people in the group. | ||
| Contract C::None => C::Or[:calculating, C::SetOf[Entitlements::Models::Person]] | ||
| def members | ||
| @members ||= begin | ||
| Entitlements.logger.debug "Calculating members from #{filename}" | ||
| members_from_rules(rules) | ||
| end | ||
| return @members if @members | ||
|
|
||
| Entitlements.logger.debug "Calculating members from #{filename}" | ||
| result = members_from_rules(rules) | ||
| @members = result unless result == :calculating | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is both a general evaluator bug fix and a requirement for smart diff: |
||
| result | ||
| end | ||
|
|
||
| # Standard interface: Get the description of this group. | ||
|
|
@@ -182,7 +184,7 @@ def rules | |
| if parsed_data.key?("modifier_expiration") && affirmative.empty? | ||
| exp_date = parsed_data.fetch("modifier_expiration").fetch("=").first.fetch(:key) | ||
| date = Entitlements::Util::Util.parse_date(exp_date) | ||
| return {"always" => false} if date <= Time.now.utc.to_date | ||
| return {"always" => false} if date <= Entitlements.evaluation_time.utc.to_date | ||
| end | ||
|
|
||
| # There has to be at least one affirmative condition, not just all negative ones. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,10 +18,12 @@ class YAML < Entitlements::Data::Groups::Calculated::Base | |
| # Returns a Set[String] with DN's of the people in the group. | ||
| Contract C::None => C::Or[:calculating, C::SetOf[Entitlements::Models::Person]] | ||
| def members | ||
| @members ||= begin | ||
| Entitlements.logger.debug "Calculating members from #{filename}" | ||
| members_from_rules(rules) | ||
| end | ||
| return @members if @members | ||
|
|
||
| Entitlements.logger.debug "Calculating members from #{filename}" | ||
| result = members_from_rules(rules) | ||
| @members = result unless result == :calculating | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is both a general evaluator bug fix and a requirement for smart diff: |
||
| result | ||
| end | ||
|
|
||
| # Standard interface: Get the description of this group. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.