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

Set latest envVersion 3 as default #2945

Merged
merged 1 commit into from
May 22, 2024
Merged

Conversation

soharab-ic
Copy link
Contributor

Description

Make latest envVersion 3 as default version.

Which issue(s) this PR fixes:

Fixes #

Testing

Now we can create env pods with poolsize=1

fission env create --name go --image fission/go-env-1.16 --builder fission/go-builder-1.16 --poolsize 1
$ kubectl get po
NAME                                         READY   STATUS    RESTARTS   AGE
go-564499-69b8db6f7-ltzhp                    2/2     Running   0          73s
poolmgr-go-default-564499-79c65c544b-mpmlz   2/2     Running   0          73s

Checklist:

  • I ran tests as well as code linting locally to verify my changes.
  • I have done manual verification of my changes, changes working as expected.
  • I have added new tests to cover my changes.
  • My changes follow contributing guidelines of Fission.
  • I have signed all of my commits.

Signed-off-by: Md Soharab Ansari <[email protected]>
Copy link

sweep-ai bot commented May 20, 2024

Sweep: PR Review

pkg/fission-cli/cmd/environment/create.go

The changes remove the automatic setting of envVersion to 2 or 3 based on the presence of EnvBuilderImage or EnvPoolsize flags, respectively, requiring users to explicitly set the environment version.

Sweep Found These Issues

  • Removing the automatic setting of envVersion to 3 when EnvPoolsize is set may lead to unexpected behavior if users relied on this implicit versioning.
  • envVersion = 1
    }
    if !input.IsSet(flagkey.EnvPoolsize) {
    console.Info("poolsize setting default to 3")

    View Diff

  • Removing the automatic setting of envVersion to 2 when EnvBuilderImage is set may lead to unexpected behavior if users relied on this implicit versioning.
  • if len(envBuilderImg) > 0 {
    if len(envBuildCmd) == 0 {
    envBuildCmd = "build"
    }
    }

    View Diff


pkg/fission-cli/flag/flag.go

The default value of the EnvVersion flag was changed from 1 to 3, altering the default environment API version used.

Sweep Found These Issues

  • Changing the default environment API version from 1 to 3 could introduce compatibility issues if version 3 is not fully backward compatible with version 1.
  • EnvKeepArchive = Flag{Type: Bool, Name: flagkey.EnvKeeparchive, Usage: "Keep the archive instead of extracting it into a directory (mainly for the JVM environment because .jar is one kind of zip archive)"}

    View Diff


test/e2e/cli/cli_test.go

The changes introduce a new variable defaultEnvVersion and add an assertion to verify that the created environment has the correct default version.


Copy link

codecov bot commented May 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.38%. Comparing base (8bfe2d0) to head (216a701).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2945      +/-   ##
==========================================
+ Coverage   45.36%   45.38%   +0.01%     
==========================================
  Files         230      230              
  Lines       23627    23619       -8     
==========================================
+ Hits        10719    10720       +1     
+ Misses      11514    11504      -10     
- Partials     1394     1395       +1     
Flag Coverage Δ
unittests 45.38% <ø> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sanketsudake sanketsudake merged commit f7e9e71 into main May 22, 2024
9 of 10 checks passed
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.

None yet

2 participants