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

werft/build/prepare: Cleanup code #8643

Merged
merged 1 commit into from
Mar 8, 2022
Merged

werft/build/prepare: Cleanup code #8643

merged 1 commit into from
Mar 8, 2022

Conversation

ArthurSens
Copy link
Contributor

Description

A couple of changes to make code cleaner:

  • Only uses exec from util/shell instead of using it from shelljs at some places.
  • Refactor the prepare function to no longer hold any logic, only calling several smaller private functions.
  • Write small functions following the "Do one thing" pattern that replaces the previous logic inside the prepare function

Related Issue(s)

Fixes #

How to test

Start a new job, you shouldn't notice any difference

Release Notes

NONE

@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #8643 (313a7c4) into main (d030750) will decrease coverage by 1.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8643      +/-   ##
==========================================
- Coverage   12.31%   11.17%   -1.14%     
==========================================
  Files          20       18       -2     
  Lines        1161      993     -168     
==========================================
- Hits          143      111      -32     
+ Misses       1014      880     -134     
+ Partials        4        2       -2     
Flag Coverage Δ
components-gitpod-cli-app 11.17% <ø> (ø)
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/local-app/pkg/auth/auth.go
components/local-app/pkg/auth/pkce.go

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d030750...313a7c4. Read the comment docs.

@ArthurSens ArthurSens requested a review from a team March 8, 2022 09:35

const werftImg = shell.exec("cat .werft/build.yaml | grep dev-environment").trim().split(": ")[1];
const devImg = shell.exec("yq r .gitpod.yml image").trim();
// TODO: The reasoning behind this step should be clarified
Copy link
Member

Choose a reason for hiding this comment

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

it's because both images need to be updated separately and letting them go out of sync may cause weird follow-up errors.

@roboquat roboquat merged commit df9f111 into main Mar 8, 2022
@roboquat roboquat deleted the as/clean-prep branch March 8, 2022 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants