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

Update admin to no longer aggregate on common #27763

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

akash1810
Copy link
Member

In SBT, aggregate means:

Aggregation means that running a task on the aggregate project will also run it on the aggregated projects.

This means if a task is run on the admin project, it'll also be run on common. This isn't necessary as we only need to compile common.

What is the value of this and can you measure success?

What does this change?

Screenshots

Checklist

In SBT, `aggregate` means:

> Aggregation means that running a task on the aggregate project will also run it on the aggregated projects.

This means if a task is run on the `admin` project, it'll also be run on `common`.
This isn't necessary as we only need to compile common.

Co-authored-by: Joe <[email protected]>
Co-authored-by: Julia <[email protected]>
Copy link
Contributor

@adamnfish adamnfish left a comment

Choose a reason for hiding this comment

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

Be aware that this means running the tests for adin won't also run the tests for common, which is probably the behaviour people expect.

Without knowing more about the error you're solving here I can't make an alternative suggestion, but make sure you aren't missing any important behaviour after doing this!

@akash1810
Copy link
Member Author

Be aware that this means running the tests for adin won't also run the tests for common, which is probably the behaviour people expect.

Is this true? Each Play app dependsOn commonWithTests, which is implemented here.

@adamnfish
Copy link
Contributor

adamnfish commented Feb 4, 2025

Be aware that this means running the tests for adin won't also run the tests for common, which is probably the behaviour people expect.

Is this true? Each Play app dependsOn commonWithTests, which is implemented here.

withTests adds the common module's tests as a dependency for the admin module's tests. You can read the following as saying "the admin code depends on the common code, and the admin tests depend on the common tests".

def withTests(project: Project): ClasspathDep[ProjectReference] =
project % "test->test;compile->compile"
}

Typically dependsOn only adds the actual source code as a dependency (the admin code depends on the common code), and the way to ask for the tests to also be included is not very intuitive, so this helper makes it a bit easier to dicover and read.

So the "with tests" helper is about code dependencies (dependsOn), aggregate is about task dependencies (aggregate).

Depends on is about making source code from other projects available, and aggregate is about making sure sbt commands are run across multiple projects at once.

In this case, by removing the common aggregation, you're saying that runnings admin/test won't also automatically run common/test. As well as people expecting this, it'd be good to double check that this isn't an important assumption in the CI checks etc. I think there's a good chance this change would cause test failures to get missed in the future, for example.

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.

2 participants