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

enhance(compiler): environment and template adjustments for local compilation #983

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

ecrupper
Copy link
Contributor

@ecrupper ecrupper commented Oct 6, 2023

This is the first of three changes that will enhance the vela exec pipeline command. These changes fall under the Server section below.

The Issue

vela exec pipeline does not work with templates. It also does not work with custom environments if the user is trying to emulate any of the default environment variables, such as VELA_BUILD_COMMIT.

Server Changes

  1. Execute the local environment sourcing after the default env override. This will ensure that user-set values that would be found in the default environment will be properly interpreted by the compiler.
  2. Adjustments to getTemplate that allows the compiler to read both from local file tree as well as remote using a GitHub token.

Worker Changes

  1. Remove calls to merge environment with default environment found in executor/local/step.go. This call is unnecessary and will only overwrite user-supplied environment values found in the default env.

CLI Changes

  1. Support for --template, --template-file, --compiler.github.token, and --compiler.github.url flags to the exec pipeline command. This will allow users the option to leverage templates in local pipeline execution, both local and remote.
  2. Support for --env-file and --env-file-path to allow users to source environment variables from a file.

@ecrupper ecrupper self-assigned this Oct 6, 2023
@ecrupper ecrupper requested a review from a team as a code owner October 6, 2023 14:33
@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Merging #983 (9c4f3c0) into main (ae4356a) will increase coverage by 0.02%.
The diff coverage is 40.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #983      +/-   ##
==========================================
+ Coverage   71.06%   71.08%   +0.02%     
==========================================
  Files         312      312              
  Lines       12996    13009      +13     
==========================================
+ Hits         9235     9247      +12     
- Misses       3295     3297       +2     
+ Partials      466      465       -1     
Files Coverage Δ
compiler/native/environment.go 86.57% <65.21%> (+4.02%) ⬆️
compiler/native/expand.go 68.51% <0.00%> (-2.73%) ⬇️

Copy link
Contributor

@plyr4 plyr4 left a comment

Choose a reason for hiding this comment

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

makes sense, nice

@ecrupper ecrupper merged commit 174ab52 into main Oct 6, 2023
11 of 13 checks passed
@ecrupper ecrupper deleted the enhance/compiler/local-exec branch October 6, 2023 15:15
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