Skip to content

Normalize all file headers to the expected Apache 2.0 license #19409

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

Closed
wants to merge 1 commit into from

Conversation

sharwell
Copy link
Contributor

@sharwell sharwell commented Feb 27, 2020

This change makes the conversion to MIT simpler by ensuring the repository starts with all headers in a known state. This change should be reviewed to make sure we aren't adding a header to a file where it would change meaning, and we aren't changing the header in a file that should keep its original header.

Edit: Only C# files are updated in this pull request. Other content types will be updated in a separate pull request.

@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files under /ws-proxy need to be excluded from this change as they are shared-source from the Mono repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these files expected to have the MIT header after all changes are made? If so, I recommend keeping them in this state for one commit since the next commit will convert everything seen in this PR to the MIT headers. Otherwise, let me know the expected final state of the files and I'll work on setting things up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they are expected to remain identical (byte-for-byte) to their current state.

// Copyright (c) Andrew Arnott. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is a legitimate change. Files under /BlazorPack are being used on a shared-source basis. I don't think we get to change the copyright header.

@@ -1,6 +1,5 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So these were taken from CoreFX I think, hence we kept their license. Assuming that we'll be switching them all back to the MIT header shortly I think this is OK, but I want to raise them as a possible oddity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the next commit changes everything here plus ~7200 other files to use the MIT header. Normalizing the headers before the change makes that one much easier to review because all changed files are changed in exactly the same way.

@@ -1,6 +1,5 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @Tratcher this will trigger our sync bot right? How does it handle license headers today? The eventual change (moving to MIT headers) should simplify things, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the bot will pick up any src difference in these shared/runtime files. Ideally runtime would have it's licence changed first. Otherwise we'll want to disable the bot until both sides are updated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or exclude the src/shared/runtime directory and deal with it later?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runtime should already be MIT?

Copy link
Member

@Tratcher Tratcher Feb 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sharwell do you want to update the licenses in the runtime repo to MIT or should I? See the readme for syncing the changes.
https://github.com/dotnet/runtime/blob/master/src/libraries/Common/src/System/Net/Http/aspnetcore/ReadMe.SharedCode.md

Copy link
Contributor

@analogrelay analogrelay Feb 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we just sync the runtime after our transition is complete using our usual process? It's still manual (even if tracked automatically).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to limit how long they're out of sync. It makes syncing other changes harder.

Copy link
Contributor

@analogrelay analogrelay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, would like @Tratcher to confirm he's at least seen this and aware of what it will do to our sync process with the runtime for src/shared/runtime

@BrennanConroy
Copy link
Member

Are .ts and .java files being checked by your script? Because there are a bunch of those that will need to be updated
Examples:
https://github.com/dotnet/aspnetcore/blob/master/src/SignalR/clients/java/signalr/src/main/java/com/microsoft/signalr/Action.java
https://github.com/dotnet/aspnetcore/blob/master/src/SignalR/clients/ts/signalr/src/AbortController.ts

@analogrelay
Copy link
Contributor

Also, we need to resolve @SteveSandersonMS 's comments before merging.

@sharwell
Copy link
Contributor Author

sharwell commented Feb 27, 2020

Are .ts and .java files being checked by your script?

@BrennanConroy Not currently. Thanks for bringing that up. I was looking at a filtered view to address managed code changes first. I'll submit a separate pull request to deal with changes in other content types.

Also, I'm not using a script. All the changes here were made by a new analyzer and code fix coming for Visual Studio hopefully in 16.6. 🎉

@Pilchie Pilchie added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Feb 27, 2020
@BrennanConroy
Copy link
Member

Looks like some tests read source files and assert the contents will need to be fixed up.

@Tratcher
Copy link
Member

Tratcher commented Mar 3, 2020

I've dealt with src/shared/runtime and src/shared/shared.tests/runtime, you can remove them from this PR.

#19518

@analogrelay analogrelay added this to the 5.0.0-preview2 milestone Mar 3, 2020
@Tratcher Tratcher removed this from the 5.0.0-preview4 milestone May 18, 2020
@Pilchie
Copy link
Member

Pilchie commented Jul 1, 2020

@sharwell - sorry for letting this sit. Can you either re-do, or teach me how to re-do, and I'll make sure to get it going this time?

@jkotalik
Copy link
Contributor

jkotalik commented Nov 5, 2020

@Pilchie should someone take over this PR? I can take a look as this has been sitting for many months.

@jkotalik jkotalik self-assigned this Nov 5, 2020
@Pilchie
Copy link
Member

Pilchie commented Nov 5, 2020

If you want, but I had pinged @sharwell in email, and he was going to take another stab at it based on some tooling/scripts he had. @sharwell - do you have an ETA for that? Should we wait for you or take this over?

@jkotalik
Copy link
Contributor

jkotalik commented Nov 5, 2020

Ah didn't know there was tooling. I'll wait to do this then.

@jkotalik jkotalik removed their assignment Nov 5, 2020
@JunTaoLuo
Copy link
Contributor

Any update @sharwell @Pilchie ?

@sharwell
Copy link
Contributor Author

sharwell commented Dec 3, 2020

I wouldn't mind someone else taking this over. It turned out to be more complex than expected on two fronts:

  1. There are a bunch of special cases (files that aren't expected to match headers)
  2. The analyzers only cover C# and Visual Basic source files, but this repository has several others

For cases that are expected to follow a standard header, the new analyzers certainly do work. 😄

@Tratcher Tratcher removed their request for review December 8, 2020 01:08
Base automatically changed from master to main January 22, 2021 01:32
@dougbu dougbu requested review from javiercn, pranavkm and a team as code owners January 22, 2021 01:32
@@ -1,5 +1,5 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.using Microsoft.AspNetCore.Authorization;
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering: Where did all of the using Microsoft.AspNetCore.Authorization; typos creep in?

Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating the files under src/Shared/runtime/ is pointless because those files be overwritten by dotnet/runtime changes (see .github/workflows/runtime-sync.yml). And, they already have MIT licenses.

@Pilchie Pilchie mentioned this pull request Jan 28, 2021
@pranavkm
Copy link
Contributor

Closing this in lieu of #34573.

@pranavkm pranavkm closed this Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.