-
Notifications
You must be signed in to change notification settings - Fork 347
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
Configure repository cloaking #10263
Comments
QuestionIf we remove things such as |
I tried to set up cloaking for the VMR, adhering to the current removal rules from current tarball generation which goes as follows:
This effectively preserves two PDB files, e.g. ProblemCurrently, we cannot do this through the cloaking system which has Proposed solutionTo solve this, we could use the From this, we could always only include files without the ignore attribute and then "not exclude" any with the keep attribute. dotnet/runtime > .gitattributes
VMR > source-mappings.json {
"defaults": {
"defaultRef": "main",
"exclude": [
"**/*.dll",
"**/*.Dll",
"**/*.exe",
"**/*.pdb",
"**/*.mdb",
"**/*.zip",
"**/*.nupkg"
]
},
"mappings": [
{
"name": "runtime",
"defaultRemote": "https://github.com/dotnet/runtime"
}
]
} This would give us a list of filters such as this:
|
@mmitche thoughts on the proposal above? Is this feasible? |
How does the cloaking relate to git as it's currently implemented today? Is git used to do the cloaking or are we implementing it ourselves? The gitattributes idea is interesting. It does look like .gitattributes allows for arbitrary attributes to be applied to a file. It is a little non-intuitive that the inclusion/exclusion metadata would be specified across multiple files, though I think well placed documentation and comments could avoid confusion there. The other option might be to say that inclusions always filter off the full possible file set, while exclusions remove off the current keep set, then use a list of globs to generate the patterns. So the equivalent would be:
|
Yeah, that might be an issue. It also sounds like another issue we might run into; what if we find files that are required for a build of one platform but are prohibited under another? Basically, required in one scenario but disallowed in another. In this case, it a dll is required for testing, but disallowed for Linux source build. Maybe this won't happen, maybe it will. Similar cases might be things like:
@MichaelSimons Do you think these scenarios may show up? Is it required that the repository that we hand to our partners already be filtered? /cc @richlander |
I'm likely missing something basic. I was thinking that cloaking would be oriented on source not binaries. Can you describe the flow, both leading up to and including the cloaking? |
@richlander looking at how we generate the tarball today, it seems like there are 2 "fake" PDB files in dotnet/runtime that have to make it to the VMR for runtime to build. The other question about breaking repo tests without checked-in binaries is connected to things like unit tests that rely on some mock artifacts, e.g. Arcade SDK has targets for manipulating nupkgs and so the unit test projects have some nupkgs checked in which serve as test subjects.
At the moment, we are actually super lucky, things are as simple as they can possibly be. We just build one Example command would be:
What git does is it adds all pathspecs into a set, then substracts all I like the proposal with an explicit ordered list of include/exclude operations but I don't see how to apply it on the git operations. To be honest, I kind of like the idea of having the final say in the repo as the repo understands this concern well but it also leaks the knowledge about the existence of the VMR into the repo (though I believe we will not completely avoid that in the future anyway). The above seems to work though I need a bit more time as I have some problems with git and applying this to a large set of files (it works fine on smaller sets, hopefully this is not a git bug). |
I think we're likely to have some info about "last synced sha" or other such info in the individual repos.
Alright, given that this is simple, native git functionality, I think using gitattributes is a reasonable way to go until we know otherwise. If you start getting into other corner cases, it may be worth looking in a different direction. |
Alright, I made it work natively, without corner cases, seems to do just what we need. What about the attribute names? We need two attributes - positive and negative, e.g. "ignore" and "preserve". They don't necessarily need to be "vmr" but can be something in the sense of "part of product".
EDIT: The diff filter when creating patches cannot do "attribute is not equal" so we cannot do |
@mmitche I wonder if this can eventually be a solution for the platform-specific files? E.g.
It could then be quite easy to synchronize these files between the actual VMRs / branches so that for example downstream RedHat would have a simple way to pull upstream minus win/osx files? (just a quick idea) It's also possible to create filters (sets of attributes) and assign those:
|
That's a possibility, but I I'd like to avoid different VMR content per platform if possible, until we absolutely need to. |
This enables the individual repos to have a final say in which files are included/excluded from the VMR by setting git attributes on files named `vmr-preserve` and `vmr-ignore`. As an example, we are generally removing all `.pdb` files, but there is a file `runtime/src/coreclr/.nuget/_.pdb` which is required. Instead of us having to tiptoe around this file in the `source-mapping.json` file which would get unmanageable pretty fast, we can add a following file into `dotnet/runtime`: **dotnet/runtime** > **src/coreclr/.nuget/.gitattributes** ``` # we could also use globs such as **/*.pdb _.pdb vmr-preserve ``` This file would then not get ignored by the `**/*.pdb` generic filter we set for all repositories. dotnet/arcade#10263
We have reach file parity between the tarball and the VMR after dotnet/installer#14706 so closing this |
Context
As part of the tarball generation process, we are removing files such as binaries or non-required files under a license. We need to either cloak these files via
source-mappings.json
or bake this step into the VMR assembly process so that these files are in place for source build to work.Goal
For this step of the tarball generation process, we need to go repo by repo and figure out what files we will need to cloak and should not be part of the VMR.
Progress
The text was updated successfully, but these errors were encountered: