8000 Individual module git tags by grantseltzer · Pull Request #1034 · aquasecurity/tracee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Individual module git tags #1034

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

Merged
merged 1 commit into from
Oct 7, 2021
Merged

Individual module git tags #1034

merged 1 commit into from
Oct 7, 2021

Conversation

grantseltzer
Copy link
Contributor
@grantseltzer grantseltzer commented Sep 30, 2021

This makes it so that individual modules in the tracee repo are properly tagged so that consumers can get versions of the individual modules instead of only git commits.

I've tested this with my personal fork here: https://github.com/grantseltzer/tracee
with a consumer here: https://github.com/grantseltzer/test-tracee-mod

Signed-off-by: grantseltzer grantseltzer@gmail.com

This makes it so that individual modules in the tracee repo
are properly tagged so that consumers can get versions of
the individual modules instead of only git commits.

Signed-off-by: grantseltzer <grantseltzer@gmail.com>
@grantseltzer
Copy link
Contributor Author

@simar7 Could you take a look at this? I'd like to implement this for the release i'll cut at end of week.

@simar7
Copy link
Member
simar7 commented Oct 6, 2021

Just trying to piece it together: IIUC, this is the end result: https://github.com/grantseltzer/tracee/releases

The tags are essentially over the entire tracee repo but just include a subset of changes in their respective projects (e.g. tracee-rules, tracee-ebpf, etc?) Is my understanding correct?

If so how does the consumer pick them up? I see https://github.com/grantseltzer/test-tracee-mod/blob/main/go.mod#L5-L9 uses the versions of v1.6.9 for tracee-ebpf for instance: https://github.com/grantseltzer/test-tracee-mod/blob/main/go.mod#L6 - Shouldn't that be tracee-ebpf/v1.6.9?

@grantseltzer
Copy link
Contributor Author
grantseltzer commented Oct 6, 2021

Just trying to piece it together: IIUC, this is the end result: https://github.com/grantseltzer/tracee/releases

Correct

The tags are essentially over the entire tracee repo but just include a subset of changes in their respective projects (e.g. tracee-rules, tracee-ebpf, etc?) Is my understanding correct?

The tags are exactly the same except for their names. If you navigate to the code in tracee-ebpf/v1.6.9 and tracee-rules/v1.6.9, it's the exact same git tree. The multiple tags are created so that go get recognizes the version for each individual module.

If so how does the consumer pick them up? I see https://github.com/grantseltzer/test-tracee-mod/blob/main/go.mod#L5-L9 uses the versions of v1.6.9 for tracee-ebpf for instance: https://github.com/grantseltzer/test-tracee-mod/blob/main/go.mod#L6 - Shouldn't that be tracee-ebpf/v1.6.9?

go get github.com/grantseltzer/tracee/tracee-ebpf@v1.6.9 will result in https://github.com/grantseltzer/test-tracee-mod/blob/main/go.mod#L6 . Please give it a try to confirm

@simar7
Copy link
Member
simar7 commented Oct 6, 2021

Just trying to piece it together: IIUC, this is the end result: https://github.com/grantseltzer/tracee/releases

Correct

The tags are essentially over the entire tracee repo but just include a subset of changes in their respective projects (e.g. tracee-rules, tracee-ebpf, etc?) Is my understanding correct?

The tags are exactly the same except for their names. If you navigate to the code in tracee-ebpf/v1.6.9 and tracee-rules/v1.6.9, it's the exact same git tree. The multiple tags are created so that go get recognizes the version for each individual module.

If so how does the consumer pick them up? I see https://github.com/grantseltzer/test-tracee-mod/blob/main/go.mod#L5-L9 uses the versions of v1.6.9 for tracee-ebpf for instance: https://github.com/grantseltzer/test-tracee-mod/blob/main/go.mod#L6 - Shouldn't that be tracee-ebpf/v1.6.9?

go get github.com/aquasecurity/tracee-ebpf@v1.6.9 will result in https://github.com/grantseltzer/test-tracee-mod/blob/main/go.mod#L6 . Please give it a try to confirm

Doesn't seem to be doing the trick:

vagrant@ubuntu-groovy:~$ go get github.com/aquasecurity/tracee-ebpf@v1.6.9
go get: github.com/aquasecurity/tracee-ebpf@v1.6.9: invalid version: unknown revision v1.6.9

vagrant@ubuntu-groovy:~$ go get github.com/aquasecurity/tracee-ebpf@tracee-ebpf/v1.6.9
go get: github.com/aquasecurity/tracee-ebpf@tracee-ebpf/v1.6.9: invalid version: version "tracee-ebpf/v1.6.9" invalid: disallowed version string

I have a feeling it might work with a tag like tracee-ebpf.v1.6.9 since it is lexically an allowed version string and would also satisfy the requirement to keep git tags unique.

@grantseltzer
Copy link
Contributor Author
grantseltzer commented Oct 6, 2021

I'm sorry I messed that up, I meant to write go get github.com/grantseltzer/tracee/tracee-ebpf@v1.6.9 (edited original post)

@simar7
Copy link
Member
simar7 commented Oct 7, 2021

I'm sorry I messed that up, I meant to write go get github.com/grantseltzer/tracee/tracee-ebpf@v1.6.9 (edited original post)

Oh yeah sorry about that I didn't notice that. Yeah it seems good to me, I could pull down that specific version.

The tags are exactly the same except for their names. If you navigate to the code in tracee-ebpf/v1.6.9 and tracee-rules/v1.6.9, it's the exact same git tree. The multiple tags are created so that go get recognizes the version for each individual module.

For my understanding, how does go get figure this out? I tried pulling down the repo and looking at the tags but I only saw tracee-ebpf/v1.6.9 for instance.

tracee-ebpf/external/v0.6.2
tracee-ebpf/external/v0.6.3
tracee-ebpf/external/v1.6.3
tracee-ebpf/external/v1.6.5
tracee-ebpf/external/v1.6.6
tracee-ebpf/external/v1.6.7
tracee-ebpf/external/v1.6.8
tracee-ebpf/external/v1.6.9
tracee-ebpf/v0.6.2
tracee-ebpf/v0.6.3
tracee-ebpf/v1.6.3
tracee-ebpf/v1.6.6
...

And for inst 8000 ance if we look at one of such commits:

commit b760f719e607f5d37c4f5505ed2c5b596e019ec2 (HEAD -> main, tag: tracee-rules/v1.6.9, tag: tracee-ebpf/v1.6.9, tag: tracee-ebpf/external/v1.6.9, origin/main, origin/HEAD)
Author: grantseltzer <grantseltzer@gmail.com>
Date:   Thu Sep 30 12:34:29 2021 -0400

    try future tag
    
    Signed-off-by: grantseltzer <grantseltzer@gmail.com>

Where are those multiple tags created? It's certainly a gap in my knowledge I'd like to supplement. But other than this lgtm.

@grantseltzer
Copy link
Contributor Author

Those were created manually, I can't test the build deployment pipeline locally unfortunately.

Here's the documentation I follow:

https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository

@simar7
Copy link
Member
simar7 commented Oct 7, 2021

Those were created manually, I can't test the build deployment pipeline locally unfortunately.

Here's the documentation I follow:

https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository

Yeah that looks good. I just didn't see the tags pushed up remotely when I downloaded the repo so was curious but if we can tag and push them its good!

@grantseltzer grantseltzer merged commit 2276d7a into aquasecurity:main Oct 7, 2021
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
0