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

Enhance CompilationDir to filter out cases outlined in #187 & #188 #190

Merged

Conversation

masterzen
Copy link
Contributor

We were having some compilation dir differences in our catalog diff because of several use cases that weren't covered by the current CompilationDir.

This change implements a different way of checking for the compilation dir so that CompilationDir supports complex parameter values (ie nested hashes/arrays) and/or strings containing the compilation dir more than once.

To be noted that the chosen implementation might be much slower than the original algorithm because it defensively dups the parameter values. This might be problematic, and I'm open to suggestion on how to better implement this feature.

As a bonus I'm including a small minor fix of the API documentation of the diff object :)

@masterzen
Copy link
Contributor Author

Oops, lot of red. Looks like I missed something :)

Brice Figureau added 2 commits June 6, 2018 21:04
…ltiple values

There were two cases where CompilationDir wasn't filtering out changes:
* if the parameter value is an arbitrary data structure (ie hash, array
or mix of both)
* if the parameter value is a string containing more than one occurence
of the compilation dir

It turns out that both can be fixed by just replacing the compilation
dirs in both the new and old values with empty strings and comparing
what's left.

It's probably much slower than the original string-only implementation
but covers much more cases as demonstrated by github#187 and github#188.
I noticed a few mistakes while reading the API documentation, and I
couldn't resist to fix them.
@masterzen masterzen force-pushed the bugfix/fix-compilatior-dir-arrays branch from 4aa1a8f to f1039dc Compare June 6, 2018 19:04
@kpaulisse kpaulisse mentioned this pull request Dec 7, 2018
@kpaulisse kpaulisse merged commit f1039dc into github:master Dec 9, 2018
Copy link
Contributor

@kpaulisse kpaulisse left a comment

Choose a reason for hiding this comment

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

Thank you for submitting this PR, and I apologize for the delay in my response. This will be included in octocatalog-diff release 1.5.4 later this week. I sincerely appreciate your contribution!

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.

None yet

2 participants