GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Caching on GHES by tiwarishub · Pull Request #308 · actions/setup-java

Conversation

@tiwarishub

@tiwarishub tiwarishub commented Mar 29, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Description:
This PR adds caching support in setup-java for GHES with version 3.5. It checks the presence of the Actions cache service(which is used for caching dependencies in GHES and dotcom) using the recent @actions/cache toolkit package function i.e isFeatureAvailable. This same function can be applied to dotcom scenario (github.com) so this function can be safely applied to dotcom scenario as well.
I have tested the below scenarios
on GHES
Current behaviour
image

With new changes. Without AC on GHES
image

With AC on GHES
save
image
restore
image

without choosing the cache option on GHES with AC
image

On dotcom

save
image

cache hit
image

without cache option
image

Related issue:
#307

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiwarishub
initial changes
282fd5a
@tiwarishub tiwarishub changed the title Cache on ghes Caching on GHES Mar 30, 2022
@tiwarishub
tiwarishub marked this pull request as ready for review March 30, 2022 06:26
@tiwarishub
tiwarishub requested review from a team and bishal-pdMSFT March 30, 2022 06:27
@tiwarishub tiwarishub assigned aparna-ravindra and marko-zivic-93 Mar 30, 2022
dmitry-shibanov
dmitry-shibanov approved these changes Mar 30, 2022
View reviewed changes
Comment thread package.json Outdated
{
"name": "setup-java",
"version": "2.0.0",
"version": "2.0.1",

@dmitry-shibanov dmitry-shibanov Mar 30, 2022

Copy link
Copy Markdown
Contributor

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 think we need to update the version according to the next release version.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tiwarishub tiwarishub Mar 30, 2022

Copy link
Copy Markdown
Contributor Author

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, we are planning to release after this PR merge

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dmitry-shibanov dmitry-shibanov Mar 30, 2022

Copy link
Copy Markdown
Contributor

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.

Could you please change version 2.0.1 to the planing one ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tiwarishub tiwarishub Mar 30, 2022

Copy link
Copy Markdown
Contributor Author

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.

@dmitry-shibanov , please share planned version

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiwarishub
tiwarishub requested a review from marko-zivic-93 March 30, 2022 07:23
@tiwarishub tiwarishub unassigned aparna-ravindra and marko-zivic-93 Mar 30, 2022
@tiwarishub
tiwarishub requested review from aparna-ravindra and brcrista March 30, 2022 07:23
brcrista
brcrista reviewed Mar 30, 2022
View reviewed changes
Comment thread src/util.ts Outdated
);
} else {
core.warning(
'An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.'

@brcrista brcrista Mar 30, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Is this message accurate? It looks like cache.isFeatureAvailable() just looks for whether an environment variable is set.

https://github.com/actions/toolkit/blob/b4639928698a6bfe1c4bdae4b2bfdad1cb75016d/packages/cache/src/cache.ts#L53

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@brcrista brcrista Mar 30, 2022

Copy link
Copy Markdown
Contributor

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.

If my understanding is correct, I would say something like

Suggested change
'An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.'
'This runner is not configured to use the cache service. Caching will be skipped.'

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tiwarishub tiwarishub Mar 30, 2022

Copy link
Copy Markdown
Contributor Author

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.

done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiwarishub
review comments
14d9168
brcrista
brcrista reviewed Mar 30, 2022
View reviewed changes
Comment thread src/util.ts Outdated
);
} else {
core.warning(
'This runner is not configured to use the cache service. Caching will be skipped'

@brcrista brcrista Mar 30, 2022

Copy link
Copy Markdown
Contributor

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.

Can we update to the same thing from actions/setup-python#363?

Suggested change
'This runner is not configured to use the cache service. Caching will be skipped'
'The runner was not able to contact the cache service. Caching will be skipped'

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tiwarishub tiwarishub Mar 31, 2022

Copy link
Copy Markdown
Contributor Author

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.

Updated with correct message

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tiwarishub added 4 commits March 31, 2022 07:03
@tiwarishub
updated with correct message
5d5e936
@tiwarishub
linting
16f95dd
@tiwarishub
update version
ce604e8
@tiwarishub
updated version
085cb63
brcrista
brcrista approved these changes Mar 31, 2022
View reviewed changes
@brcrista

brcrista commented Mar 31, 2022

Copy link
Copy Markdown
Contributor

Looks like a test is failing: https://github.com/actions/setup-java/runs/5769289844?check_suite_focus=true#step:7:461

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marko-zivic-93
marko-zivic-93 approved these changes Mar 31, 2022
View reviewed changes
@tiwarishub

tiwarishub commented Mar 31, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Looks like a test is failing: https://github.com/actions/setup-java/runs/5769289844?check_suite_focus=true#step:7:461

Yes this is failing on master as well #309 https://github.com/actions/setup-java/runs/5773757120?check_suite_focus=true#step:7:404

Update:
NowCI fixed on master #310

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tiwarishub
Merge branch 'actions:main' into cacheOnGhes
31eb46e
@brcrista
brcrista merged commit dc1a9f2 into actions:main Mar 31, 2022
@dmitry-shibanov dmitry-shibanov mentioned this pull request Apr 7, 2022
Improve error handling for restore caching #297
Closed
2 tasks
tdfacer pushed a commit to ifit/setup-java that referenced this pull request Oct 7, 2025
@tiwarishub
Caching on GHES (actions#308)
139020e
* initial changes

* review comments

* updated with correct message

* linting

* update version

* updated version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bishal-pdMSFT bishal-pdMSFT Awaiting requested review from bishal-pdMSFT
@aparna-ravindra aparna-ravindra Awaiting requested review from aparna-ravindra
3 more reviewers
@dmitry-shibanov dmitry-shibanov dmitry-shibanov approved these changes
@brcrista brcrista brcrista approved these changes
@marko-zivic-93 marko-zivic-93 marko-zivic-93 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@tiwarishub @brcrista @dmitry-shibanov @marko-zivic-93 @aparna-ravindra
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.