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

Add test for pipedv1's buildPlan method, and remove platform specific config from configv1's GenericApplicationConfig #5238

Merged
merged 9 commits into from
Oct 1, 2024

Conversation

Warashi
Copy link
Contributor

@Warashi Warashi commented Sep 27, 2024

What this PR does / why we need it:

  • Add test for pipedv1's buildPlan method
  • remove platform-specific config from configv1's GenericApplicationConfig
    • and remove platform/stage specific test that is broken by the above changes

Which issue(s) this PR fixes:

Part of #4980

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Comment on lines 64 to 79
func (s *GenericApplicationSpec) UnmarshalJSON(data []byte) error {
type Alias GenericApplicationSpec
var aux Alias

if err := json.Unmarshal(data, &aux); err != nil {
return err
}

if err := defaults.Set(&aux); err != nil {
return err
}

*s = GenericApplicationSpec(aux)
return nil
}

Copy link
Contributor Author

@Warashi Warashi Sep 27, 2024

Choose a reason for hiding this comment

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

Oops, these changes are mistakenly commited. I'll remove these changes.
→ Done

Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
@Warashi Warashi changed the title Add test for pipedv1's buildPlan method, and remove platform specific config from GenericApplicationConfig Add test for pipedv1's buildPlan method, and remove platform specific config from configv1's GenericApplicationConfig Sep 27, 2024
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 31.25000% with 33 lines in your changes missing coverage. Please review.

Project coverage is 23.99%. Comparing base (988949a) to head (85c0a79).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/pipedv1/controller/planner.go 34.88% 25 Missing and 3 partials ⚠️
pkg/configv1/config.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5238      +/-   ##
==========================================
+ Coverage   23.94%   23.99%   +0.04%     
==========================================
  Files         437      438       +1     
  Lines       46994    46883     -111     
==========================================
- Hits        11255    11248       -7     
+ Misses      34835    34744      -91     
+ Partials      904      891      -13     
Flag Coverage Δ
23.99% <31.25%> (+0.04%) ⬆️

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.

t-kikuc
t-kikuc previously approved these changes Sep 30, 2024
Comment on lines 276 to 280
cfg := new(config.GenericApplicationSpec)
if err := json.NewDecoder(bytes.NewReader(targetDS.ApplicationConfig)).Decode(cfg); err != nil {
p.logger.Error("unable to parse application config", zap.Error(err))
return nil, err
}
Copy link
Member

Choose a reason for hiding this comment

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

It could be better to move this part to configv1 package, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I'll move this to configv1, like LoadApplication.

func LoadApplication(repoPath, configRelPath string, appKind model.ApplicationKind) (*GenericApplicationSpec, error) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed on this commit
b9e9261

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified again based on face-to-face mtg
85c0a79

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

LGTM, great step done 💯

@Warashi Warashi enabled auto-merge (squash) October 1, 2024 06:01
@Warashi Warashi merged commit 44cfc93 into master Oct 1, 2024
15 of 17 checks passed
@Warashi Warashi deleted the pipedv1-api-plugin-planner-dsp branch October 1, 2024 06:01
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.

4 participants