Skip to content

Allow plugin reader to ignore dependents of plugins#12854

Closed
nineinchnick wants to merge 3 commits intotrinodb:masterfrom
nineinchnick:plugin-reader-ignore-dependents
Closed

Allow plugin reader to ignore dependents of plugins#12854
nineinchnick wants to merge 3 commits intotrinodb:masterfrom
nineinchnick:plugin-reader-ignore-dependents

Conversation

@nineinchnick
Copy link
Copy Markdown
Member

Description

When the plugin reader is used to map impacted plugins to features, it should not ignore the whole list when the dependents of plugins are included. In Trino that can only be core/trino-server but it currently doesn't define dependencies explicitly, because it would duplicate its Provisio manifest.

Is this change a fix, improvement, new feature, refactoring, or other?
improvement

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)
test tools

How would you describe this change to a non-technical end user or system administrator?
n/a

Related issues, pull requests, and links

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Jun 15, 2022
@electrum
Copy link
Copy Markdown
Member

Can you give an example scenario that this would improve? Something like "a PR that touches a file in X would previous do Y but now does Z"

@nineinchnick
Copy link
Copy Markdown
Member Author

Can you give an example scenario that this would improve? Something like "a PR that touches a file in X would previous do Y but now does Z"

@electrum let me try:

A PR that adds a dependency on a Trino plugin in any module that's not a plugin would previously disable impact analysis in product tests CI jobs and now the new dependent module can be added to a list of exceptions.

WDYT? We should generally ignore all dependents of plugins but I don't want to pull in Maven code into the Plugin reader and I don't think there's a high chance of any other module than core/trino-server depending on plugins, which I already added in the CI job.

@electrum
Copy link
Copy Markdown
Member

I don't think there's a high chance of any other module than core/trino-server depending on plugins

We plan to squash the hive-hadoop2 plugin into the main Hive module. There’s no need at this point for a separate module. At that point, Iceberg and Delta plugins will depend on the Hive plugin.

@nineinchnick nineinchnick added the no-release-notes This pull request does not require release notes entry label Jul 18, 2022
@nineinchnick nineinchnick force-pushed the plugin-reader-ignore-dependents branch from 4fabc4c to cb9f80b Compare September 22, 2022 07:50
@nineinchnick nineinchnick force-pushed the plugin-reader-ignore-dependents branch from cb9f80b to 095d285 Compare October 13, 2022 10:40
@nineinchnick nineinchnick force-pushed the plugin-reader-ignore-dependents branch from 095d285 to 7590818 Compare October 13, 2022 11:42
Jan Was added 2 commits October 13, 2022 13:54
If the server and/or rpm modules are impacted, the list list
of impacted modules should not be empty, because otherwise
it will cause all tests to run.
@nineinchnick nineinchnick force-pushed the plugin-reader-ignore-dependents branch from 7590818 to 60fdd2f Compare October 13, 2022 11:54
@nineinchnick
Copy link
Copy Markdown
Member Author

@hashhar PTAL, this should fix the recently discovered issue with PRs that only change the trino-server-rpm module.

@findepi PTAL, this should fix running all product tests in PRs.

@nineinchnick
Copy link
Copy Markdown
Member Author

I tested this in nineinchnick#14

@findepi
Copy link
Copy Markdown
Member

findepi commented Oct 13, 2022

@findepi PTAL, this should fix running all product tests in PRs.

@nineinchnick thanks!

still, i'd prefer someone else reviews this. I have no prior experience with the plugin reader and surrounding functionalities.

@nineinchnick
Copy link
Copy Markdown
Member Author

@findepi I extracted that commit into #14624

Copy link
Copy Markdown
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

making sure i understand things correctly

Stream<Map.Entry<String, String>> modulesStream = requireNonNull(modulesToPlugins).entrySet().stream();
if (impactedModules.isPresent()) {
List<String> nonPluginModules = impactedModules.get().stream().filter(module -> !modulesToPlugins.containsKey(module)).collect(Collectors.toList());
List<String> nonPluginModules = impactedModules.get().stream()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably best to rename this variable since it's no longer just nonPluginModules.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also add context to commit message of " Allow plugin reader to ignore dependents of plugins "

IIUC this means we now apply impact analysis in product tests if change is in core/trino-server or core/trino-server-rpm whereas earlier we'd have just run all tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That brings up concern - what happens when in future some plugin module gets used as dependency in other plugin module?

It might not be as concerning since the only impact would be we'd run more product tests than needed?

run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$MAVEN validate ${MAVEN_FAST_INSTALL} ${MAVEN_GIB} -Dgib.logImpactedTo=gib-impacted.log -pl '!:trino-docs,!:trino-server-rpm'
$MAVEN validate ${MAVEN_FAST_INSTALL} ${MAVEN_GIB} -Dgib.logImpactedTo=gib-impacted.log -pl '!:trino-docs'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the list list in commit message for "Don't exclude server modules when checking impacted modules"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I extracted this commit into #14632

- name: Build PT matrix (all)
if: |
github.event.name != 'pull_request' ||
github.event_name != 'pull_request' ||
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this was extracted - remove this commit?

@nineinchnick
Copy link
Copy Markdown
Member Author

I closed this because after giving it another thought I don't think we should be doing impact analysis when we know that some dependants of plugins have changed.

@nineinchnick nineinchnick deleted the plugin-reader-ignore-dependents branch May 27, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

4 participants