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

removed ODO log command #4566

Conversation

msivasubramaniaan
Copy link
Collaborator

Ref: #4396

Removed Show Log and Follow Log on the dropdown of component. We can use Watch Logs on Deployments and Pods in application explorer view.

Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 43.81%. Comparing base (da60441) to head (e704971).
Report is 607 commits behind head on main.

Files with missing lines Patch % Lines
src/explorer.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4566       +/-   ##
===========================================
+ Coverage   32.37%   43.81%   +11.44%     
===========================================
  Files          85       99       +14     
  Lines        6505     8052     +1547     
  Branches     1349     1709      +360     
===========================================
+ Hits         2106     3528     +1422     
- Misses       4399     4524      +125     

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

Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
Copy link
Contributor

@vrubezhny vrubezhny left a comment

Choose a reason for hiding this comment

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

Once we don't use show&watch logs - shouldn't we remove the commands themselves here:

static showLog(platform?: string): CommandText {
const result = new CommandText('odo', 'logs', [
new CommandOption('--dev'),
]);
if (platform) {
result.addOption(new CommandOption('--platform', platform));
}
return result;
}
static showLogAndFollow(platform?: string): CommandText {
return Command.showLog(platform).addOption(new CommandOption('--follow'));
}
?

@vsCommand('openshift.component.log', true)
static async log(componentFolder: ComponentWorkspaceFolder): Promise<void> {
const componentName = componentFolder.component.devfileData.devfile.metadata.name;
const showLogCmd = Command.showLog(Component.getDevPlatform(componentFolder));
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we remove the command itself then?

@vsCommand('openshift.component.followLog', true)
static async followLog(componentFolder: ComponentWorkspaceFolder): Promise<void> {
const componentName = componentFolder.component.devfileData.devfile.metadata.name;
const showLogCmd = Command.showLogAndFollow(Component.getDevPlatform(componentFolder));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. Shouldn't we remove the command itself?

@@ -230,10 +230,6 @@
"onCommand:openshift.component.describe",
"onCommand:openshift.component.openInBrowser",
"onCommand:openshift.component.describe.palette",
"onCommand:openshift.component.log",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@vrubezhny I removed the command as well

datho7561
datho7561 previously approved these changes Oct 17, 2024
Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

Seems good to me. Thanks, Muthu!

@vrubezhny
Copy link
Contributor

@msivasubramaniaan Please take a look at #4566 (review) - I mean, you're removing all the "show/watch log"-like commands from palette/context menu/etc., but you're not removing the code in odo/command.ts that contains the methods that provide the implementations for these 'ODO` commands:

static showLog(platform?: string): CommandText {...}

static showLogAndFollow(platform?: string): CommandText {...}

... which look like aren't used anymore (after your PR is merged).

Do you want to keep these methods for any reason?

Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
@msivasubramaniaan
Copy link
Collaborator Author

@msivasubramaniaan Please take a look at #4566 (review) - I mean, you're removing all the "show/watch log"-like commands from palette/context menu/etc., but you're not removing the code in odo/command.ts that contains the methods that provide the implementations for these 'ODO` commands:

static showLog(platform?: string): CommandText {...}

static showLogAndFollow(platform?: string): CommandText {...}

... which look like aren't used anymore (after your PR is merged).

Do you want to keep these methods for any reason?

@vrubezhny yes you were right. I removed those implementation as well. But I expect that compiler will show error/warning on the unused code. Need to add eslint rule to show error/warning on unused methods.

Copy link
Contributor

@lgrossma lgrossma Oct 18, 2024

Choose a reason for hiding this comment

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

Is it necessary to delete these two tests entirely? If odo log gets replaced by different solution, these tests could be still used.. (Maybe some changes would be needed, but the workflow could stay the same)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As plan to get rid of ODO, I removed the whole code and these log functionality is working through oc logs. But not in the component level. It will be on deployment and pod level.

Copy link
Contributor

Choose a reason for hiding this comment

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

I still think it is pretty handy to be able to check the logs in component view and not having to look for the right deployment in the deployments view..

Copy link
Contributor

@vrubezhny vrubezhny left a comment

Choose a reason for hiding this comment

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

Look good to me. Thanks!

@msivasubramaniaan msivasubramaniaan merged commit 2502721 into redhat-developer:main Oct 18, 2024
4 checks passed
@msivasubramaniaan msivasubramaniaan deleted the 4396-get-rid-of-odo-log-command branch October 18, 2024 13:15
@vrubezhny vrubezhny added this to the 1.17.0 milestone Nov 26, 2024
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.

5 participants