8000 Readme updates for granular control by kotewar · Pull Request #1017 · actions/cache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Readme updates for granular control #1017

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

Conversation

kotewar
Copy link
Contributor
@kotewar kotewar commented Dec 6, 2022

Description

Readme changes for the granular cache control initiative

Motivation and Context

These docs will give the users more clarity about the two new actions

How Has This Been Tested?

NA, tested in workflows

Screenshots (if appropriate):

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.

@kotewar kotewar changed the base branch from releases/v3-beta to 700-actionscache-granular-cache-control December 6, 2022 05:15
@kotewar kotewar marked this pull request as ready for review December 14, 2022 04:41
@kotewar kotewar requested a review from a team as a code owner December 14, 2022 04:41
README.md Outdated
Comment on lines 11 to 14
[Restore action](./restore/README.md)

[Save action](./save/README.md)

Copy link
Contributor

Choose a reason for hiding this comment

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

This can be moved to previous section, where you can call out that in addition to cache actions, other two actions are also available.

* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
* `key` - String used while saving cache for restoring the cache
* `restore-keys` - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key.
> **Note**
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this? It is good for user to use same keys but they can use any key they want.
This statement may scare them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can be removed, existing users would be knowing this already. But I just added this for the new users to know that the key+path combination has to be present in both actions to restore/save the same cache.

We don't want users to file bugs for these trivial cases due to lack of info. 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct. It is good to expose this information, but may be not here. People are here to just quickly understand the inputs and use the action. Too much detail will confuse them and can cause drop off. You anyways have use cases and tips sections. Move this info to there. Here you can just leave a link to those section. For example - See here to refer how these inputs can be used effectively for some common use cases.

### Environment Variables
* `SEGMENT_DOWNLOAD_TIMEOUT_MINS` - Segment download timeout (in minutes, default `60`) to abort download of the segment if not completed in the defined number of minutes. [Read more](https://github.com/actions/cache/blob/main/workarounds.md#cache-segment-restore-timeout)

## Outputs
Copy link
Contributor

Choose a reason for hiding this comment

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

May be outputs section should come before environment variables one.

Copy link
Contributor Author
@kotewar kotewar Dec 14, 2022

Choose a reason for hiding this comment

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

We are following the same sequence in the cache action readme as well.

Also, environment variable is some sort of input only right? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking from user perspective. Output is more common need than env. In a doc we should start with more commonly useful info at top and then go down to less common useful ones.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking from user perspective. Output is more common need than env. In a doc we should start with more commonly useful info at top and then go down to less common useful ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

save/README.md Outdated

### Re-evaluate cache key while saving

Some technologies like dot-net generate the lockfiles during the build time, due to which the already evaluated `${{ hashFiles('**/lockfiles') }}` hash doesn't match the actual hash. Using save action with the same key will not re-evaluate the key as the hash was generated during restores. However passing the expression to re-evaluate the hash would generate a new key in the save action now as save would be called after the build step.
Copy link
Contributor

Choose a reason for hiding this comment

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

Too verbose. Just mention that this action allows re-evaluation of key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

kotewar and others added 6 commits December 15, 2022 00:06
Co-authored-by: Bishal Prasad <bishal-pdmsft@github.com>
Co-authored-by: Bishal Prasad <bishal-pdmsft@github.com>
Co-authored-by: Bishal Prasad <bishal-pdmsft@github.com>
Co-authored-by: Bishal Prasad <bishal-pdmsft@github.com>
Co-authored-by: Bishal Prasad <bishal-pdmsft@github.com>
@kotewar kotewar merged commit c30e6dc into 700-actionscache-granular-cache-control Dec 15, 2022
@kotewar kotewar deleted the kotewar/readme-updates-for-granular-control branch December 19, 2022 03:52
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.

2 participants
0