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

[Rule Request] Per-Model Exceptions to BPA Rules #51

Open
InsightABI opened this issue Jan 31, 2022 · 1 comment
Open

[Rule Request] Per-Model Exceptions to BPA Rules #51

InsightABI opened this issue Jan 31, 2022 · 1 comment

Comments

@InsightABI
Copy link

I'm not sure if this is a more of a BPA feature suggestion or a BPA Rule suggestion, but I think this could be done in the rule expression. We are utilizing Git for our CI/CD process and we invoke TE3 via CLI in Git to run the BPA to check before we allow a PR to be created or merged.

Because each model is different and will therefore have it's own exceptions to the rules, can we put every existing rule's LINQ script inside of a "wrapper" that checks to see if the rule should apply to this particular model and then exit if it doesn't?

//Wrapper Pseodo-code
IF Model.Name IN (array of model's to be ignored for this rule)
EXIT
ELSE
run regular LINQ script
END IF

@otykier
Copy link
Collaborator

otykier commented Feb 7, 2022

Yes, if you remember to specify explicit names for your models, you can absolutely add that type of logic to each rule:

For example, if a rule should apply only to Model1, Model2 and Model3, use this:

(Model.Name = "Model1" or Model.Name = "Model2" or Model.Name = "Model3")
and
... // Regular LINQ expression

However, in my opinion, exceptions should be specified on the individual models, instead of on each rule. This can be done simply by loading a model in TE, then disable the rules you do not want to apply to that model. This information is then stored in an annotation on the model, so the next time the model is loaded, or when the BPA is executed through CLI, any rules specified as exceptions on the annotation will not be checked.

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

No branches or pull requests

2 participants