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

httpcaddyfile: Revise automation policy generation #3824

Merged
merged 2 commits into from
Oct 29, 2020
Merged

Conversation

mholt
Copy link
Member

@mholt mholt commented Oct 28, 2020

This should fix a frustrating edge case where wildcard subjects are
used, which potentially get shadowed by more specific versions of
themselves; see the new tests for an example. This change is motivated
by an actual customer requirement.

Although all the tests pass, this logic is incredibly complex and
nuanced, and I'm worried it is not correct. But it took me about 4 days
to get this far on a solution. I did my best.

This is actually a better solution to b6686a5 I think.

This should fix a frustrating edge case where wildcard subjects are
used, which potentially get shadowed by more specific versions of
themselves; see the new tests for an example. This change is motivated
by an actual customer requirement.

Although all the tests pass, this logic is incredibly complex and
nuanced, and I'm worried it is not correct. But it took me about 4 days
to get this far on a solution. I did my best.
@mholt mholt added this to the v2.3.0 milestone Oct 28, 2020
Copy link
Member

@francislavoie francislavoie left a comment

Choose a reason for hiding this comment

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

"Hide whitespace changes" helped here, some of the blocks where somewhat misaligned in the diff because the tabulation was changed.

I don't think I have a 100% grasp on this, but I think it all makes sense.

👍

@mholt
Copy link
Member Author

mholt commented Oct 29, 2020

I don't think I have a 100% grasp on this,

Me neither tbh 😬

but I think it all makes sense.

Oh good! Because it doesn't for me 😅

Actually, so, it kinda makes sense, but it's just really really sensitive to changes, there's a lot of logic that is obvious to a human when writing a JSON config for automation policies, but that is hard to generalize into a correct algorithm.

@mholt
Copy link
Member Author

mholt commented Oct 29, 2020

Gonna merge this early and see if anyone using HEAD will report regressions as soon as possible.

@mholt mholt merged commit db4f1c0 into master Oct 29, 2020
@mholt mholt deleted the caddyfile-ap branch October 29, 2020 02:36
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