Use zq's Zeek tag as the downloaded dependency #1215
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This is a companion PR to brimdata/zed#1610, which would merge first once both are approved.)
Currently Brim's
scripts/download-zdeps
pulls down a specific Zeek artifact (and soon a Suricata one as well) to run tests and allows for the bundling of these artifacts with the app such that users can generate such logs on the desktop. zq similarly depends on the same artifacts during system tests to ensure pcaps posted tozqd
produce expected log outputs.Up until now, this all has meant updating the Zeek & Suricata tags in each repo separately, ideally keeping them always in sync. However, we already have linkage between the repos in the form of the advance-zq.yml Action that gets notified of a new zq commit hash whenever there's a merge to master on the zq side, ultimately committing the advanced zq pointer in Brim if the tests pass. By piggybacking on that same approach, we can maintain the Zeek/Suricata tags on just the zq side and ensure they start being used on the Brim side as long as triggered Brim-side tests pass.
The implementation of the zq build on the Brim side uses
npm
. Therefore in brimdata/zed#1610, the Zeek/Suricata tags are moved out of the Makefile and into zq'spackage.json
, which is already used by this cross-repo build process. Now whenever annpm install
is done on the Brim side, the contents ofnode_modules/zq/package.json
will be updated with the Zeek/Suricata tags that were present on the zq side as of the zq commit hash referenced in Brim'spackage.json
.Here's some proof of it working by having done an
npm install
of the commit hash associated with the head commit from the branch in brimdata/zed#1610:This same approach needs to work with tagged versions as well. Here we can see it failing because the tags aren't in the last GA tagged release. But we can see the
package.json
for that tagged release was still where it needs to be, so this should work fine the next time we tag a release.We can expect the CI will fail on this branch until something on the zq side is populating the
package.json
. Therefore if/when both PRs are approved, I'll plan to merge the zq one first such that Brim's zq pointer inpackage.json
gets advanced in Brim's master, then catch this branch up with master so it'll run green before merging.