Skip to content
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

[chores] Revert copyright start year + polish #2732

Merged
merged 6 commits into from
Jul 2, 2021

Conversation

simonbasle
Copy link
Member

@simonbasle simonbasle commented Jul 1, 2021

This reverts the change of start date, then using Spotless without a ratchet to
detect files that were still missing a copyright notice header.

Spotless should actually correctly detect and update end in both the range
case (start-end), the early single year case (start to start-end) and the
current year as single year case (end, kept as is).

Unfortunately, locally this gives a lot of "noisy" changes because the blank
line after the notice had not been enforced in #2722, while spotlessApply does
enforce it.
Such blank-line-only changes were not added to the commit, thanks to the
following command:

git diff --ignore-blank-lines | grep "+++ b/" | sed s/"\+\+\+ b\/"// | xargs git add

The other thing is that applying spotless to the whole codebase surfaced a few
files that have different copyright header (scrabble and annotations). These
have been excluded from spotless for now.

  • Revert "[polish] All license header date range start at 2011"
  • [build] Spotless license use YEAR variable, will recognize ranges
  • [build] Spotless copyright check excludes scrabble + annotations
  • [chores] Fix copyright notice header of several recent files

Follow-up to #2722, see reactor/reactor#682

This reverts commit 6fa6182.

The start year MUST reflect the actual year the _content_ of the file
(copyrighted material) has been created.
 - scrabble classes copyright notice was not originally completely clean
 and will need to be improved separately
 - NonNull/NonNullApi/Nullable annotations have been taken from Spring
 with original copyright notice
simonbasle added a commit that referenced this pull request Jul 1, 2021
Most files were missing the header altogether. Introduced header in
that case was manually edited to include the proper start year at which
each class was created.

reactor/util/concurrent/MpscLinkedQueue.java had a notice between the
copyright notice block and the package statement, which could get erased
by spotlessApply, so it was moved next to class javadoc.

A few changed classes here deal with deleting duplicated copyright
notice blocks.

See reactor/reactor#682.
@simonbasle simonbasle added type/chores A task not related to code (build, formatting, process, ...) for/merge-with-rebase Reminder to merge the PR in rebase mode (several semantic commits) labels Jul 1, 2021
@simonbasle simonbasle added this to the 3.3.19.RELEASE milestone Jul 1, 2021
@simonbasle simonbasle requested a review from a team July 1, 2021 12:02
@simonbasle simonbasle marked this pull request as ready for review July 1, 2021 12:03
@simonbasle simonbasle requested a review from a team as a code owner July 1, 2021 12:03
@@ -28,6 +24,10 @@

import reactor.util.annotation.Nullable;

/*
* The code was inspired by the similarly named JCTools class:
Copy link
Member Author

Choose a reason for hiding this comment

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

this was moved otherwise spotlessApply would erase it (if before the package statement)

Most files were missing the header altogether. Introduced header in
that case was manually edited to include the proper start year at which
each class was created.

reactor/util/concurrent/MpscLinkedQueue.java had a notice between the
copyright notice block and the package statement, which could get erased
by spotlessApply, so it was moved next to class javadoc.

A few changed classes here deal with deleting duplicated copyright
notice blocks.

See reactor/reactor#682.
@simonbasle simonbasle marked this pull request as draft July 1, 2021 16:13
@simonbasle simonbasle marked this pull request as ready for review July 1, 2021 16:18
By using `-PspotlessFrom=ALL` one can disable ratchetting entirely.
We can now ignore ratchetting with `ALL`. In this commit we use that
and the spotless feature that slurps years from git history:

```bash
gradle spotlessApply -PspotlessSetLicenseHeaderYearsFromGitHistory=true -PspotlessFrom=ALL
```

The following command has been used to get a bird's eye view of the automated
change from spotless:

```bash
git diff -U0 | grep "^[+-]" | grep --invert-match "^[+-][+-][+-]" | sort | uniq --count
```

which gave:

```
    255 +
     87 + * Copyright (c) 2015-2021 VMware Inc. or its affiliates, All Rights Reserved.
    492 + * Copyright (c) 2016-2021 VMware Inc. or its affiliates, All Rights Reserved.
    122 + * Copyright (c) 2017-2021 VMware Inc. or its affiliates, All Rights Reserved.
     39 + * Copyright (c) 2018-2021 VMware Inc. or its affiliates, All Rights Reserved.
     17 + * Copyright (c) 2019-2021 VMware Inc. or its affiliates, All Rights Reserved.
     12 + * Copyright (c) 2020-2021 VMware Inc. or its affiliates, All Rights Reserved.
      4 + * Copyright (c) 2021 VMware Inc. or its affiliates, All Rights Reserved.
    761 - * Copyright (c) 2011-2021 VMware Inc. or its affiliates, All Rights Reserved.
      8 - * Copyright (c) 2019-2021 VMware Inc. or its affiliates, All Rights Reserved.
      4 - * Copyright (c) 2020-2021 VMware Inc. or its affiliates, All Rights Reserved.
```

Thus it appears the change only touched copyright notice lines, without any
pattern standing out.

Reviewed-in: #2733
@simonbasle simonbasle merged commit 9996658 into 3.3.x Jul 2, 2021
simonbasle added a commit that referenced this pull request Jul 2, 2021
This reverts commit 6fa6182.

The start year MUST reflect the actual year the _content_ of the file
(copyrighted material) has been created.
@reactorbot
Copy link

@simonbasle this PR seems to have been merged on a maintenance branch, please ensure the change is merge-forwarded to intermediate maintenance branches and up to main 🙇

simonbasle added a commit that referenced this pull request Jul 2, 2021
 - scrabble classes copyright notice was not originally completely clean
 and will need to be improved separately
 - NonNull/NonNullApi/Nullable annotations have been taken from Spring
 with original copyright notice
simonbasle added a commit that referenced this pull request Jul 2, 2021
Most files were missing the header altogether. Introduced header in
that case was manually edited to include the proper start year at which
each class was created.

reactor/util/concurrent/MpscLinkedQueue.java had a notice between the
copyright notice block and the package statement, which could get erased
by spotlessApply, so it was moved next to class javadoc.

A few changed classes here deal with deleting duplicated copyright
notice blocks.

See reactor/reactor#682.
simonbasle added a commit that referenced this pull request Jul 2, 2021
By using `-PspotlessFrom=ALL` one can disable ratchetting entirely.
@simonbasle simonbasle deleted the copyrightRevertStartYear branch July 2, 2021 13:51
@simonbasle
Copy link
Member Author

simonbasle commented Jul 2, 2021

@simonbasle this PR seems to have been merged on a maintenance branch, please ensure the change is merge-forwarded to intermediate maintenance branches and up to main 🙇

forward merge done, but newly introduced files in 3.4.x have not been reviewed/fixed. will do this in a separate PR, given the breadth of the change and the need to apply the spotless recompute from git task on new files.

simonbasle added a commit that referenced this pull request Jul 2, 2021
simonbasle added a commit that referenced this pull request Jul 2, 2021
This commit polishes the merge of #2732 and reviews the start year
of copyright notice headers for files that have been introduced in 3.4.x
or otherwise differ from 3.3.x (for example main's NextProcessor derives
from 3.3.x's MonoProcessor).
simonbasle added a commit that referenced this pull request Jul 2, 2021
This commit polishes the merge of #2732 and reviews the start year
of copyright notice headers for files that have been introduced in 3.4.x
or otherwise differ from 3.3.x (for example main's NextProcessor derives
from 3.3.x's MonoProcessor).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for/merge-with-rebase Reminder to merge the PR in rebase mode (several semantic commits) type/chores A task not related to code (build, formatting, process, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants