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 detail spec for platform provider and kind in the plugin architecture #5357

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

ffjlabo
Copy link
Member

@ffjlabo ffjlabo commented Nov 21, 2024

What this PR does:

Defined to use the DeployTarget instead of Platform Provider, and labels["kind"] instead of Kind in the plugin architecture.

Why we need it:

We plan to introduce the alternatives for PlatformProvider and Kind: K8sApp, ECSApp, ... (existing kind) in the plugin architecture.

But we should consider the backward compatibility. So I wrote how to do that in the rfc.

Which issue(s) this PR fixes:

Part of #5252

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: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.41%. Comparing base (669bbd2) to head (1b32141).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5357   +/-   ##
=======================================
  Coverage   25.41%   25.41%           
=======================================
  Files         445      446    +1     
  Lines       47793    47807   +14     
=======================================
+ Hits        12146    12150    +4     
- Misses      34697    34708   +11     
+ Partials      950      949    -1     

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


🚨 Try these New Features:

Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

Almost LGTM. I commented on one nitpick.

Comment on lines 170 to 194
```golang
func (a * Application) GetKind() string {
// First, check the application is supported by the plugin architecture. It means that the kind is set to "Application".
// If so, return the kind from the labels.
if a.Kind == ApplicationKind_Application {
return a.Labels["kind"]
}

// For backward compatibility, return the kind as string
return a.Kind.String()
}
```

```golang
func (d *Deployment) GetKind() string {
// First, check the application is supported by the plugin architecture. It means that the kind is set to "Application".
// If so, return the kind from the labels.
if d.Kind == ApplicationKind_Application {
return d.Labels["kind"]
}

// For backward compatibility, return the kind as string
return d.Kind.String()
}
```
Copy link
Contributor

Choose a reason for hiding this comment

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

[nits] These snippets seem duplicated.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Warashi
Actually, they are not duplicate 🙏
The one is for Application, the another is for Deployment. (See the receiver)

It is confusing, so fixed to add the title for each method details.
1b32141

Copy link
Contributor

Choose a reason for hiding this comment

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

@ffjlabo Oops, thanks 🙏🏻

Signed-off-by: Yoshiki Fujikane <[email protected]>
Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Look neat to me 👍

@ffjlabo ffjlabo merged commit a5ca8df into master Nov 21, 2024
18 checks passed
@ffjlabo ffjlabo deleted the add-detail-for-plugin-architecture branch November 21, 2024 07:58
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