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

Fix stf sha issue #2913

Merged
merged 23 commits into from
Oct 1, 2021
Merged

Fix stf sha issue #2913

merged 23 commits into from
Oct 1, 2021

Conversation

xius666
Copy link
Contributor

@xius666 xius666 commented Sep 29, 2021

No description provided.

@@ -75,21 +75,37 @@
<echo message="This branch does not exist!"/>
</then>
</if>
<if>
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of if, should this be else block? Also, I would like to have git checkout logic once.
pseudocode:

run git rev-parse ${stf_branch} // failonerror="false" and get stf_sha1
If code=128 {
    git rev-parse origin/${stf_branch} // set failonerror="true" and set stf_sha2
     if code2 =128 {
           // error. fail the build. if set failonerror="true" works as expected, we do not need this if block
      } else {
          // success. Set stf_sha
         <property stf_sha value="${stf_sha2}"/>
      }
}
if  stf_sha is not set {
      // set it to stf_sha1
      <property stf_sha value="${stf_sha1}"/>
}
run git checkout -q -f ${stf_sha}

Copy link
Contributor Author

@xius666 xius666 Sep 30, 2021

Choose a reason for hiding this comment

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

I changed the logic according to the pseudocode, it is indeed a cleaner approach, and I also rerun on the grinder(1514,1515,1516).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks a lot, @xius666 !

@llxia
Copy link
Contributor

llxia commented Sep 30, 2021

Grinder for the default case: https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/1518/

@llxia
Copy link
Contributor

llxia commented Sep 30, 2021

One more thing, could you update to set failonerror="true" for git clone in the following line?

<exec executable="git" failonerror="false" dir="${SYSTEMTEST_ROOT}">

If this fails, it means stf_repo is wrong. We should fail the build.

@xius666
Copy link
Contributor Author

xius666 commented Sep 30, 2021

@llxia thanks for the suggestion, changed it pl review

Copy link
Contributor

@llxia llxia left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@LongyuZhang LongyuZhang left a comment

Choose a reason for hiding this comment

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

LGTM

@LongyuZhang LongyuZhang merged commit 55c3295 into adoptium:master Oct 1, 2021
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.

3 participants