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

Issue #11729: Automate update of releasenotes.xml by content for new … #11750

Merged
merged 1 commit into from Jun 26, 2022
Merged

Issue #11729: Automate update of releasenotes.xml by content for new … #11750

merged 1 commit into from Jun 26, 2022

Conversation

Rahulkhinchi03
Copy link
Member

@Rahulkhinchi03 Rahulkhinchi03 commented Jun 17, 2022

Resolves #11729

File: releasenotes-gen-auto.sh to test the updates.

xdocs.xml:

    <section name="Release 10.4">
      <div class="releaseDate">17.06.2022</div>
      <p>Bug fixes:</p>
        <ul>
          <li>
            FallThrough should recognize yield also.
            Author: Hyeonmin Park
            <a href="https://github.com/checkstyle/checkstyle/issues/11712">#11712</a>
          </li>
          <li>
            FinalClassCheck: False positive with anonymous classes.
            Author: Vyom-Yadav
            <a href="https://github.com/checkstyle/checkstyle/issues/11365">#11365</a>
          </li>
        </ul>
      <p>Notes:</p>
        <ul>
          <li>
            Move Backport section on index page to be update JRE_and_JDK .
            Author: Roman Ivanov
            <a href="https://github.com/checkstyle/checkstyle/issues/11735">#11735</a>
          </li>
          <li>
            .ci/pitest.sh --list doesn&#39;t show all pitest profiles.
            Author: Vyom-Yadav
            <a href="https://github.com/checkstyle/checkstyle/issues/11730">#11730</a>
          </li>
          <li>
            update code base to have javadoc tag to explain noinspection tag
content.
            Author: Nick Mancuso
            <a href="https://github.com/checkstyle/checkstyle/issues/11277">#11277</a>
          </li>
          <li>
            Split pitest-coding execution into 3 executions and investigate
instability.
            Author: Vyom-Yadav
            <a href="https://github.com/checkstyle/checkstyle/issues/11528">#11528</a>
          </li>
          <li>
            Use Shellcheck to resolve violations code in Shell Script.
            Author: Rahul Khinchi
            <a href="https://github.com/checkstyle/checkstyle/issues/11637">#11637</a>
          </li>
          <li>
            Add &#39;git diff&#39; validation after execution of verify phase to
Azure.
            Author: Rahul Khinchi
            <a href="https://github.com/checkstyle/checkstyle/issues/11554">#11554</a>
          </li>
          <li>
            Solve fb-contrib errors.
            Author: pbludov
            <a href="https://github.com/checkstyle/checkstyle/issues/11140">#11140</a>
          </li>
          <li>
            Checkstyle doesn&#39;t publish test source code.
            Author: rnveach
            <a href="https://github.com/checkstyle/checkstyle/issues/11681">#11681</a>
          </li>
        </ul>
    </section>

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Please remove token from code.
Let's for now prepare shell script to be executed on my local (full RW access)

.ci/releasenotes-gen-auto.sh Outdated Show resolved Hide resolved
.ci/releasenotes-gen-auto.sh Outdated Show resolved Hide resolved
.ci/releasenotes-gen-auto.sh Outdated Show resolved Hide resolved
.ci/releasenotes-gen-auto.sh Outdated Show resolved Hide resolved
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

items:

.ci/releasenotes-gen-auto.sh Outdated Show resolved Hide resolved
.ci/releasenotes-gen-auto.sh Outdated Show resolved Hide resolved
.ci/releasenotes-gen-auto.sh Outdated Show resolved Hide resolved
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

please prove that it works.

please share log of execution on your local that pushes results in your fork - share result commits.

items:

.ci/releasenotes-gen-auto.sh Outdated Show resolved Hide resolved
@Rahulkhinchi03
Copy link
Member Author

Rahulkhinchi03 commented Jun 20, 2022

LINK TO COMMIT: Rahulkhinchi03@683e9c0
(It has not changed any file, as the command executed in .ci-temp/checkstyle but locally I can see it):

svdsvsdv

SCRIPT USED:

#!/bin/bash
set -e

source ./.ci/util.sh

checkout_from https://github.com/checkstyle/contribution

cd .ci-temp/contribution/releasenotes-builder
mvn -e --no-transfer-progress clean compile package
cd ../../../

if [ -d .ci-temp/checkstyle ]; then
  cd .ci-temp/checkstyle/
  git reset --hard origin/master
  git pull origin master
  git fetch --tags
  cd ../../
else
  cd .ci-temp/
  git clone https://github.com/Rahulkhinchi03/checkstyle
  cd ../
fi

CS_RELEASE_VERSION="$(getCheckstylePomVersion)"
echo CS_RELEASE_VERSION="$CS_RELEASE_VERSION"

cd .ci-temp/checkstyle
LATEST_RELEASE_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo LATEST_RELEASE_TAG="$LATEST_RELEASE_TAG"

cd ../
NOTES_DIR="contribution/releasenotes-builder/src/main/resources/com/github/checkstyle/templates/"

java -jar contribution/releasenotes-builder/target/releasenotes-builder-1.0-all.jar \
        -localRepoPath checkstyle \
         -remoteRepoPath Rahulkhinchi03/checkstyle \
        -startRef "$LATEST_RELEASE_TAG" \
         -releaseNumber "$CS_RELEASE_VERSION" \
        -githubAuthToken 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 \
         -generateXdoc \
        -xdocTemplate $NOTES_DIR/xdoc_freemarker.template \
         -publishXdoc -publishXdocWithPush

echo "releasenotes.xml after commit:"
head "checkstyle/src/xdocs/releasenotes.xml" -n 30

Execution:

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.123 s
[INFO] Finished at: 2022-06-20T06:42:17+05:30
[INFO] ------------------------------------------------------------------------
Cloning into 'checkstyle'...
remote: Enumerating objects: 208170, done.
remote: Counting objects: 100% (134/134), done.
remote: Compressing objects: 100% (104/104), done.
remote: Total 208170 (delta 38), reused 77 (delta 15), pack-reused 208036
Receiving objects: 100% (208170/208170), 81.46 MiB | 4.49 MiB/s, done.
Resolving deltas: 100% (119165/119165), done.
Updating files: 100% (4668/4668), done.
CS_RELEASE_VERSION=10.4-SNAPSHOT
LATEST_RELEASE_TAG=prepare-10.4.1

Execution succeeded!
releasenotes.xml after commit:
<?xml version="1.0" encoding="UTF-8"?>

<document xmlns="http://maven.apache.org/XDOC/2.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">

  <head>
    <title>Release Notes</title>
  </head>

  <body>
    <!-- placeholder for a new section -->


    <section name="Release 10.4-SNAPSHOT">
      <div class="releaseDate">20.06.2022</div>
      <p>Notes:</p>
        <ul>
          <li>
            Delete releasenotes-gen-xdocs-push.sh.
            Author: Rahul Khinchi
          </li>
          <li>
            Create releasenotes-gen-xdocs-push.sh.
            Author: Rahul Khinchi
          </li>
        </ul>
    </section>
    <section name="Release 10.3">
      <div class="releaseDate">29.05.2022</div>

@romani
Copy link
Member

romani commented Jun 20, 2022

Release notes after update has two weird empty line, can you explain why it happens?
We need to avoid to them

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

.ci/releasenotes-gen-auto.sh Outdated Show resolved Hide resolved
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

.ci/releasenotes-gen-xdoc-push.sh Outdated Show resolved Hide resolved
.ci/releasenotes-gen-xdoc-push.sh Show resolved Hide resolved
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

.ci/releasenotes-gen-xdoc-push.sh Outdated Show resolved Hide resolved
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

.ci/releasenotes-gen-xdoc-push.sh Outdated Show resolved Hide resolved
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

items:

.ci/releasenotes-gen-xdoc-push.sh Outdated Show resolved Hide resolved
@romani romani merged commit caa1951 into checkstyle:master Jun 26, 2022
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.

Automate update of releasenotes.xml by content for new release
2 participants