-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add source control information extensibility point #3063
Add source control information extensibility point #3063
Conversation
@rainersigwald @AndyGerlicher @eerhardt @jeffkl @nguerrera PTAL |
Any target that reads SourceRevisionId, PrivateRepositoryUrl, and other source control related | ||
properties and items should depend on this target. | ||
|
||
Source control information provider that sets these properties and items shall override this target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should they override this target? or BeforeTargets
it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is there can be only one override
, so if 2 things want to set these properties/items...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There can only be one source control provider for a project. Having multiple doesn't make much sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it to BeforeTargets
. There might potentially be scenario when one target fills in some information and another target (using the same source control) fills in more info.
src/Tasks/Microsoft.Common.props
Outdated
<!-- | ||
PrivateRepositoryUrl is the URL of the repository supplied by the CI server or retrieved from source control manager. | ||
|
||
This value is not directly embedded in build outputs to avoid inadvertently publishing links to private repositories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I follow what this property is actually used for. Here we say what it is NOT used for, but never what it IS used for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next line explains. I'm open to suggestions to word it better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next line says ‘PublishRepositoryUrl’ property. Is that a type-o or really a different property? I thought it was a different prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's different property. Let me reword this to be clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nits on the comments.
@richlander FYI |
@eerhardt Updated the comments. Let me know if it's clearer now. |
src/Tasks/Microsoft.Common.props
Outdated
PrivateRepositoryUrl is the URL of the repository supplied by the CI server or retrieved from source control manager. | ||
|
||
Targets consuming this property shall not publish its value implicitly as it might inadvertently reveal an internal URL. | ||
Instead, they shall only do so if the project sets PublishRepositoryUrl property to true. For example, the NuGet Pack target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they shall only do so if the project sets PublishRepositoryUrl property to true
Ok - this helped me understand what is going on. Thanks!
@rainersigwald I'd like to get this into VS 15.7 and the next dotnet SDK (whatever the version number is). Should I retarget the PR to vs15.7 branch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. If @rainersigwald is ok with it we can merge. master
is correct for 15.7.
this target (by including InitializeSourceControlInformation in its BeforeTargets) and set | ||
source control properties and items that haven't been initialized yet. | ||
--> | ||
<Target Name="InitializeSourceControlInformation" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to insert the DependsOn property we talked about somewhere so folks can inject into this but still have a package compatible with VS2015?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i'll add the property.
I also have one more piece of feedback coming from NuGet team to look into before we merge.
9bfd5ef
to
c34c7fe
Compare
@AndyGerlicher @rainersigwald Based on feedback from NuGet team I have conditioned reading the For example, if
|
@nguerrera FYI |
c34c7fe
to
5a1c178
Compare
On second thought, since we need to make the usage of Standard CI opt-in and thus they are not defaults anymore it seems it would be better to look at Standard CI as another source information provider and move the properties to a separate package ( Updated PR to only include the target that serves as a sync point for consumers and producers of the source control info. |
@rainersigwald Could you please merge? |
Source control information provider that sets these properties and items shall execute before this target (by including | ||
InitializeSourceControlInformation in its BeforeTargets) and set source control properties and items that haven't been initialized yet. | ||
--> | ||
<Target Name="InitializeSourceControlInformation" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you decide that we didn't need a DependsOn property here? I thought we wanted that for some packages that wanted to support downlevel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added SourceControlInformationFeatureSupported
so that they can condition on that. Let me double check that this property is actually reasonable to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks everyone! |
Adds a few extensibility points to common targets that enable source control and SourceLink package features and fully deterministic compilation.
See https://github.com/tmat/repository-info/blob/master/docs/Readme.md for details.
TODO:
Supersedes #2960