Skip to content

Conversation

@martijnvans
Copy link
Contributor

@martijnvans martijnvans commented Jul 6, 2022

This is action item #1 from this document: https://docs.google.com/document/d/1TFJ-OhIm2KmATv-sam3aLlZz8T5vMp7zsHSMxp0kVtw/edit?usp=sharing&resourcekey=0-JWBhMrd2SdUg1VYHvwuNtw

The idea is to make it impossible to forget to update supported_applications.txt, instead requiring each metadata.yaml file to contain an additional field called supported_operating_systems, containing either linux, windows, or linux_and_windows.

This PR involved a lot of reshuffling in third_party_apps_test.go in order to get the parsed metadata.yaml to be accessible early on in the test. I moved the metadata.yaml parsing out of runSingleTest and into determineAllApps (which got renamed to fetchAppsAndMetadata), which runs right at the beginning of the test, before any VMs are started up.

@martijnvans martijnvans requested a review from sophieyfang July 7, 2022 15:13
@martijnvans
Copy link
Contributor Author

all the kokoro failures are unrelated, going to go ahead and merge.

ExpectedMetrics []*ExpectedMetric `yaml:"expected_metrics" validate:"onetrue=Representative,unique=Type,dive"`
MinimumSupportedAgentVersion MinimumSupportedAgentVersion `yaml:"minimum_supported_agent_version"`
SupportedAppVersion []string `yaml:"supported_app_version" validate:"required,unique,min=1"`
SupportedOperatingSystems string `yaml:"supported_operating_systems" validate:"required,oneof=linux windows linux_or_windows"`
Copy link
Contributor

Choose a reason for hiding this comment

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

@avilevy18 and I were discussing adding a Platform key instead, which would mark the test as Linux vs Windows. This would match the work on adding a metadata.yaml for the default agent metrics in #719.

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'm not understanding this suggestion. Where would this key go, and how is it different from what i have besides the name? I just don't get it.

}
allApps[app] = metadata
}
log.Printf("found %v apps", len(allApps))
Copy link
Contributor

Choose a reason for hiding this comment

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

The old code logged the apps; this code just logs the number of apps. I wonder how this will affect debuggability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The impacted apps list is still logged, on line 460.

I think it's fine to just log the number of apps here, since at this point there's no realistic way for it to be wrong anyway. It has to have a valid metadata.yaml file for each app or it will return an error and never get to this point anyway.

Comment on lines 488 to 490
if supported == "linux_and_windows" {
return "" // This app supports both Linux and Windows.
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just omit this when both Linux and Windows are supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

try as I might, I can't understand this suggestion.

@martijnvans martijnvans merged commit 3c9d980 into master Jul 22, 2022
@martijnvans martijnvans deleted the martijnvans-remove-supported-applications branch July 22, 2022 16:31
martijnvans added a commit that referenced this pull request Sep 2, 2022
#723 deleted these functions, but they were mistakenly added back, probably due to a bad merge, in #719 (which was merged after 723).
martijnvans added a commit that referenced this pull request Sep 3, 2022
#723 deleted these functions, but they were mistakenly added back, probably due to a bad merge, in #719 (which was merged after 723).
@martijnvans martijnvans mentioned this pull request Sep 21, 2022
9 tasks
martijnvans added a commit that referenced this pull request Sep 22, 2022
It is superseded by an entry in metadata.yaml.

These files were meant to be deleted in #723, but it looks like i neglected to actually delete it there.
martijnvans pushed a commit that referenced this pull request Sep 26, 2022
File is no longer used as of #723 but was not deleted.
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.

5 participants