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

Update Primer venv caching [ci] #7708

Merged
merged 4 commits into from Nov 7, 2022

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Nov 4, 2022

Description

Followup to #7651 (comment)

To prevent a Primer / Run failure if the hash changes, add separate step to create venv in that workflow too. With Github actions cache scoping, the cache entry can only be used for the specific PR.

Additionally, remove install of bleeding-edge astroid. That only works as long as the main astroid branch doesn't contain any breaking changes.

With the new cache key, it's no longer necessary to update the CACHE_VERSION when doing an astroid update.

/CC: @DanielNoord, @Pierre-Sassoulas

@cdce8p cdce8p added Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer Maintenance Discussion or action around maintaining pylint or the dev workflow labels Nov 4, 2022
@cdce8p cdce8p added this to the 2.15.6 milestone Nov 4, 2022
@cdce8p cdce8p added the Skip news 🔇 This change does not require a changelog entry label Nov 4, 2022
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3393900183

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.381%

Totals Coverage Status
Change from base Build 3393010334: 0.0%
Covered Lines: 17241
Relevant Lines: 18076

💛 - Coveralls

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

🤖 Effect of this PR on checked open source code: 🤖

Effect on sentry:
The following messages are now emitted:

  1. no-member:
    Generator 'generator' has no 'enter' member
    https://github.com/getsentry/sentry/blob/d6c3d0079301f681be0f174071fc44af5076b4fd/src/sentry/utils/pytest/fixtures.py#L441
  2. no-member:
    Generator 'generator' has no 'exit' member
    https://github.com/getsentry/sentry/blob/d6c3d0079301f681be0f174071fc44af5076b4fd/src/sentry/utils/pytest/fixtures.py#L443
  3. no-member:
    Generator 'generator' has no 'enter' member
    https://github.com/getsentry/sentry/blob/d6c3d0079301f681be0f174071fc44af5076b4fd/src/sentry/models/file.py#L214
  4. no-member:
    Generator 'generator' has no 'exit' member
    https://github.com/getsentry/sentry/blob/d6c3d0079301f681be0f174071fc44af5076b4fd/src/sentry/models/file.py#L216

This comment was generated for commit 8bad978

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

It make sense to remove astroid bleeding edge imo, as we're not running on astroid bleeding edge anywhere else so it's confusing. Maybe we could run the pylint primer on astroid bleeding edge directly in astroid's CI. I don't know on with which pylint, as long as there are no breaking change in astorid the latest published pylint is the best one but it's hard to know what to use during the time where astroid has breaking change and bleeding edge pylint is not ready for it yet.

Let's wait for primer experts review (@jacobtylerwalls , @DanielNoord ) before merging :)

@Pierre-Sassoulas Pierre-Sassoulas added the Needs review 🔍 Needs to be reviewed by one or multiple more persons label Nov 4, 2022
@jacobtylerwalls
Copy link
Member

My intent behind installing astroid bleeding edge in the primer was that it provides the greatest opportunity for finding new false positives caused in pylint PRs. It would be difficult to look through the haystack of closed PRs for examples, but I thought I saw potential regressions on PRs that were only evident when using astroid bleeding edge. I also wasn't too worried about breaking changes, because breaking-changes-on-main-causing-astroid-error == breaking-changes-on-pr-causing-astroid-error, but I guess that has the potential to hide some false positives, outweighing the original motivation. I guess it comes down to how often we forecast having breaking changes in astroid versus having regressions on pylint PRs we could otherwise catch.

@cdce8p
Copy link
Member Author

cdce8p commented Nov 5, 2022

Maybe we could run the pylint primer on astroid bleeding edge directly in astroid's CI.

That would be awesome. At the moment, I manually check bigger astroid PRs against Home Assistant just to have a first sanity check.

My intent behind installing astroid bleeding edge in the primer was that it provides the greatest opportunity for finding new false positives caused in pylint PRs. It would be difficult to look through the haystack of closed PRs for examples, but I thought I saw potential regressions on PRs that were only evident when using astroid bleeding edge.

Not so sure about this one but maybe I'm missing something. Isn't the only case this would be useful if both an unreleased astroid change and some potential pylint change that uses the astroid one come together? Even then, we'll need to bisect astroid either way. Idk tbh, this seems like a fairly remote case. Without testing bleeding edge, it would show up in the astroid bump PR which I think I would prefer.

Either way the best workaround is probably to do frequent astroid releases if there are any new features. We have gotten a lot better with those lately. The new release process has definitely helped a lot.

@jacobtylerwalls
Copy link
Member

Without testing bleeding edge, it would show up in the astroid bump PR which I think I would prefer.

That's fine, it's just the case that the original contributor would be long gone. Unless...

Either way the best workaround is probably to do frequent astroid releases if there are any new features. We have gotten a lot better with those lately. The new release process has definitely helped a lot.

👍🏻

Isn't the only case this would be useful if both an unreleased astroid change and some potential pylint change that uses the astroid one come together?

Yes, but without the "use" of the astroid feature being intended. As astroid gets more powerful, more Uninferables turn into real nodes, and this increases the surface area of the primer. So someone's pylint PR for a small positive in something completely unrelated crashes when something obscure in flask is newly inferred correctly as a lambda and doesn't have a .__qname__ that the pylint contributor was relying on, and we get the benefit of knowing without waiting for the astroid upgrade. The idea was to have the largest possible surface area for the primer at the moment we have the contributor's attention.

Ultimately I think you have a good point--the faster release cadence is a good reason to remove astroid bleeding edge in the primer. Was just adding some context.

@Pierre-Sassoulas Pierre-Sassoulas merged commit 5e3f01b into pylint-dev:main Nov 7, 2022
@cdce8p cdce8p deleted the primer-cache branch November 7, 2022 09:22
@Pierre-Sassoulas Pierre-Sassoulas added Backported and removed Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer labels Nov 16, 2022
Pierre-Sassoulas pushed a commit that referenced this pull request Nov 16, 2022
* Use release version for astroid
* Use better cache key
* Mirror create environment
* Update comments
Pierre-Sassoulas pushed a commit that referenced this pull request Nov 17, 2022
* Use release version for astroid
* Use better cache key
* Mirror create environment
* Update comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported Maintenance Discussion or action around maintaining pylint or the dev workflow Needs review 🔍 Needs to be reviewed by one or multiple more persons Skip news 🔇 This change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants