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(yarn2): only set immutable cache if cache available #832

Closed

Conversation

mlavina
Copy link

@mlavina mlavina commented Aug 14, 2020

I ran into an issue where I didn't have cache committed into source because I was using node-linker and didn't think i needed that.

I added this first commit to warn about that if someone else runs into that issue

But i was going to add a second commit to disable immutable cache if you are using node-linker

What are your thoughts @danielleadams @lillianzhang331 ?

Should we disable immutable-cache for all node-linkers? Should there be a different opt-out param similar to yarn_production? Should there be an opt-out at all?

@mlavina mlavina requested a review from a team as a code owner August 14, 2020 16:03
@@ -109,6 +109,11 @@ yarn_2_install() {

echo "Running 'yarn install' with yarn.lock"
cd "$build_dir" || return

if ! has_yarn_cache "$build_dir"; then
echo "Yarn cache is required. See https://devcenter.heroku.com/articles/migrating-to-yarn-2#make-changes-to-source-code for additional information"
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about changing this to:

if ! has_yarn_cache "$build_dir"; then
  monitor "yarn-2-install-with-node-modules" yarn install 2>&1
else
 ...

Copy link
Author

Choose a reason for hiding this comment

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

that's what i thought of doing originally but i didn't want to be presumption with asking your team first haha.

@mlavina mlavina force-pushed the mlavina/feat/heroku/immutableCache branch from 5dcdaac to 6895115 Compare August 14, 2020 17:44
@mlavina
Copy link
Author

mlavina commented Aug 14, 2020

@danielleadams any ideas why the hatchet stuff is failing. I tested locally with make heroku-20. I can try a full make test but that's going to take a bit on my laptop

@mlavina mlavina changed the title fix(yarn2): warn if cache is not committed fix(yarn2): Only run immutable cache in yarn 2 if caching enabled Aug 17, 2020
@mlavina mlavina changed the title fix(yarn2): Only run immutable cache in yarn 2 if caching enabled fix(yarn2): only set immutable cache if cache available Aug 17, 2020
@mlavina
Copy link
Author

mlavina commented Aug 24, 2020

QQ @lillianzhang331 will #833 solve the hatchet issue here. I am sorry, but I don't really understand what the hatchet test is and why it's failing in my PR

@lillianzhang331
Copy link
Contributor

Hi @mlavina, #833 was opened to test existing behavior in the buildpack, so I don't think it conflicts with this PR. It wouldn't hurt to pull in those tests though!

@mlavina mlavina force-pushed the mlavina/feat/heroku/immutableCache branch 2 times, most recently from 23e86b3 to 4a2bd87 Compare August 26, 2020 12:55
@mlavina
Copy link
Author

mlavina commented Aug 26, 2020

@lillianzhang331 I ran make test fully locally and it works. I don't understand why CI test=Hatchet is failing and everything is passing. The error on the CI seems to be

fetch': key not found: "HEROKU_API_USER" (KeyError)

Do I have to register my username somewhere?

@danielleadams
Copy link
Contributor

@mlavina Hatchet tests are only supposed to run when members of Heroku team open pull requests (and when we create tests to check release acceptance). cc @lillianzhang331 We may want to check why the Hatchet tests are running when a contributors open PRs

@danielleadams
Copy link
Contributor

(Not sure if it was always like that, but HEROKU_API_USER would refer to Heroku members and we have done some work on our CI recently, so it's likely we (ie. I) may have broken the testing workflow for contributors)

@danielleadams
Copy link
Contributor

@mlavina do you mind rebasing this? I am back from vacation, so I can work on getting this in this week.

@mlavina mlavina force-pushed the mlavina/feat/heroku/immutableCache branch from 4a2bd87 to 9c9030e Compare September 8, 2020 18:48
@mlavina
Copy link
Author

mlavina commented Sep 8, 2020

@danielleadams rebased

@danielleadams
Copy link
Contributor

@mlavina Going to fix these tests and then we can get it merged. Thanks again for the work!

@danielleadams
Copy link
Contributor

There's a configuration the CI isn't picking up. I'm going to try closing the pull request and reopening to see if it picks it up.

@danielleadams
Copy link
Contributor

@mlavina For some reason the Travis build is not picking up the environment variables - I think this is because the pull request was created before the variables were added. Do you mind creating a new pull request? Sorry for the additional work. No need to write an explanation - you can just link this PR because we'll want to reference the discussion here anyways. Thanks!

@mlavina
Copy link
Author

mlavina commented Sep 8, 2020

sorry this is being so confusing i opened up #836

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