Skip to content

Conversation

@kotewar
Copy link
Contributor

@kotewar kotewar commented Dec 20, 2022

Description

For save only action, it is important for users to know that the save has failed due to any reason, hence we've added a warning to show the same.

Motivation and Context

Make user experience better by highlighting any warnings/issues in the workflow run

How Has This Been Tested?

Local workflow

Save action - https://github.com/kotewar/test-continue-on-error-for-cache/actions/runs/3742275202
Default cache action - https://github.com/kotewar/test-continue-on-error-for-cache/actions/runs/3742531272/jobs/6353592058#step:13:665

Screenshots (if appropriate):

NA

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (add or update README or docs)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@github-actions github-actions bot requested a review from lvpx December 20, 2022 16:19
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install && npm run build"
"postCreateCommand": "npm install"
Copy link
Contributor Author

@kotewar kotewar Dec 20, 2022

Choose a reason for hiding this comment

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

npm run build take a very long time while setting up the codespace, hence removing it from here.

try {
if (!utils.isCacheFeatureAvailable()) {
return;
return 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will return 0 when we don't want to log a warning, and -1 when we want to log a warning.

@kotewar kotewar marked this pull request as ready for review December 20, 2022 16:21
@kotewar kotewar requested a review from a team as a code owner December 20, 2022 16:21
try {
if (!utils.isCacheFeatureAvailable()) {
return;
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

0 may be a real cacheId as DB entry starts at 0. Should we use something like -2

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 we can. I was thinking, in the future we can also map the negative numbers to some error types to decide how to log/show error to the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used -2 now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Lets do that now itself. We can define an enum on cache return type.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually re-thinking about this. Why do we need to return id here. Can we return error here. Any error and SaveOnly should print warning message. No?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this mean we also need to implement error handling in save.ts?

@kotewar kotewar merged commit 64a59d5 into releases/v3-beta Dec 21, 2022
@kotewar kotewar deleted the kotewar/save-warnings branch December 21, 2022 11:46
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.

4 participants