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

GenCode - Reduce merge-conflicts on AllCoreTables #10182

Merged
merged 1 commit into from
Apr 19, 2017

Conversation

totten
Copy link
Member

@totten totten commented Apr 18, 2017

The previous checksum was based on the full schema spec. This is
technically safe, but many irrelevant schema changes (such as editing field
comments) will ding the checksum.

The main goal here is to avoid $template->run() (line ~44) and its
code-beautifier (which is expensive/slow). This revised algorithm for
needsUpdate() should:

  • Still be "fast enough" (given that it's a singular file built from a simple template)
  • Still be "accurate enough" (given that getRaw() is a fair predictor of run())
  • Be less prone to merge-conflics (given that it doesn't use the checksum)

Ping @colemanw

The previous checksum was based on the full schema spec.  This is
technically safe, but many irrelevant schema changes (such as editing field
comments) will ding the checksum.

The main goal here is to avoid `$template->run()` (line ~44) and its
code-beautifier (which is expensive/slow).  This revised algorithm for
`needsUpdate()` should:

 * Still be "fast enough" (given that it's a singular file built from a simple template)
 * Still be "accurate enough" (given that `getRaw()` is a fair predictor of `run()`)
 * Be less prone to merge-conflics (given that it doesn't use the checksum)
@colemanw
Copy link
Member

So does this unconditionally make the checksum in AllCoreTables.data.php "IGNORE"? or only when the tables don't change?

@totten
Copy link
Member Author

totten commented Apr 19, 2017

Yes, the checksum is just set to IGNORE. We could probably rip out all references to the checksums from the php/tpl. (The general idea of this change is to ignore the checksum -- because the remaining test (isApproxPhpMatch(file_get(), getRaw())) should still fast/good-enough for this particular file.)

In the near-term, I think this means that the pre-existing AllCoreTables.data.php would remain in place (despite the fact that its checksum is different/old). Eventually, when there is a substantive change, the file would regenerate, and the checksum would appear as literal IGNORE.

@colemanw colemanw merged commit be4c4a8 into civicrm:master Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants