Coder Social home page Coder Social logo

Comments (8)

xmlking avatar xmlking commented on July 22, 2024

I added the following custom task affected, to test it out. why all modules got affected even after I have committed all changes to develop branch?

    val affected = register<Test>("affected") {
        subprojects.forEach {
            println("Is ${it.name} Affected? : "+ com.dropbox.affectedmoduledetector.AffectedModuleDetector.isProjectAffected(it))
        }
    }
 gradle affected
Type-safe dependency accessors is an incubating feature.
Type-safe project accessors is an incubating feature.

> Configure project :
Version: 1.6.5-SNAPSHOT,  Branch: develop, isCI: false
SpotlessChangelog Version Next: 1.7.0-SNAPSHOT  Last: 1.6.4
Is apps Affected? : true
Is libs Affected? : true
Is account-service Affected? : true
Is chat-service Affected? : true
Is classifier-pipeline Affected? : true
Is entity-service Affected? : true
Is greeting-service Affected? : true
Is ingestion-pipeline Affected? : true
Is keying-service Affected? : true
Is linking-service Affected? : true
Is person-service Affected? : true
Is wordcount-pipeline Affected? : true
Is core Affected? : true
Is kbeam Affected? : true
Is model Affected? : true
Is pipeline Affected? : true
Is proto Affected? : true
Is service Affected? : true
Is test Affected? : true

from affectedmoduledetector.

digitalbuddha avatar digitalbuddha commented on July 22, 2024

Could you include the log file please.

from affectedmoduledetector.

xmlking avatar xmlking commented on July 22, 2024

here is the output

[INFO] [amd] Modules provided: null
[INFO] [amd] Using real detector with ALL_AFFECTED_PROJECTS
[INFO] [amd] running command git rev-parse develop in /Users/schintha/Developer/Work/java/micro-apps
[INFO] [amd] Response: 4c3ba5885d9062d32704012ebd1f1a137fd892e9

[INFO] [amd] running command git --no-pager diff --name-only 4c3ba5885d9062d32704012ebd1f1a137fd892e9 in /Users/schintha/Developer/Work/java/micro-apps
[INFO] [amd] Response: 
[INFO] [amd] unknownFiles: [], changedProjects: [], buildAll: true
[INFO] [amd] Building all projects
[INFO] [amd] because no changed files were detected
[INFO] [amd] checking whether I should include :apps:account-service and my answer is true
[INFO] [amd] checking whether I should include :apps:chat-service and my answer is true
[INFO] [amd] checking whether I should include :apps:classifier-pipeline and my answer is true
[INFO] [amd] checking whether I should include :apps:entity-service and my answer is true
[INFO] [amd] checking whether I should include :apps:greeting-service and my answer is true
[INFO] [amd] checking whether I should include :apps:ingestion-pipeline and my answer is true
[INFO] [amd] checking whether I should include :apps:keying-service and my answer is true
[INFO] [amd] checking whether I should include :apps:linking-service and my answer is true
[INFO] [amd] checking whether I should include :apps:person-service and my answer is true
[INFO] [amd] checking whether I should include :apps:wordcount-pipeline and my answer is true
[INFO] [amd] checking whether I should include :libs:core and my answer is true
[INFO] [amd] checking whether I should include :libs:core and my answer is true
[INFO] [amd] checking whether I should include :libs:kbeam and my answer is true
[INFO] [amd] checking whether I should include :libs:kbeam and my answer is true
[INFO] [amd] checking whether I should include :libs:model and my answer is true
[INFO] [amd] checking whether I should include :libs:model and my answer is true
[INFO] [amd] checking whether I should include :libs:pipeline and my answer is true
[INFO] [amd] checking whether I should include :libs:pipeline and my answer is true
[INFO] [amd] checking whether I should include :libs:proto and my answer is true
[INFO] [amd] checking whether I should include :libs:proto and my answer is true
[INFO] [amd] checking whether I should include :libs:service and my answer is true
[INFO] [amd] checking whether I should include :libs:service and my answer is true
[INFO] [amd] checking whether I should include :libs:test and my answer is true
[INFO] [amd] checking whether I should include :libs:test and my answer is true

just F.Y.I: I changed my custom task and target to root project

// Define Custom Task
open class AffectedTask : DefaultTask() {
    @TaskAction
    fun printAffected() {
        project.subprojects.forEach {
            println("Is ${it.name} Affected? : " + com.dropbox.affectedmoduledetector.AffectedModuleDetector.isProjectAffected(it))
        }
    }
}

// Register Custom Task with root project
register<AffectedTask>("affected") {
    group = "Affected Module Detector"
    description = "print all affected subprojects due to code changes"
}

gradle affected

gradle affected                             
Type-safe dependency accessors is an incubating feature.
Type-safe project accessors is an incubating feature.

> Configure project :
Version: 1.6.5-SNAPSHOT,  Branch: develop, isCI: false
SpotlessChangelog Version Next: 1.7.0-SNAPSHOT  Last: 1.6.4

> Task :affected
Is apps Affected? : true
Is libs Affected? : true
Is account-service Affected? : true
Is chat-service Affected? : true
Is classifier-pipeline Affected? : true
Is entity-service Affected? : true
Is greeting-service Affected? : true
Is ingestion-pipeline Affected? : true
Is keying-service Affected? : true
Is linking-service Affected? : true
Is person-service Affected? : true
Is wordcount-pipeline Affected? : true
Is core Affected? : true
Is kbeam Affected? : true
Is model Affected? : true
Is pipeline Affected? : true
Is proto Affected? : true
Is service Affected? : true
Is test Affected? : true

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

from affectedmoduledetector.

xmlking avatar xmlking commented on July 22, 2024

Git commit log

commit 4c3ba5885d9062d32704012ebd1f1a137fd892e9 (HEAD -> develop, origin/develop, origin/HEAD)
Author: Sumanth Chinthagunta <[email protected]>
Date:   Fri Jun 25 10:32:37 2021 -0700

    style(lint): adding OptIn to fix kotlin lints

commit 183bd1b99dfa0860d63df96cc61a433bba739be0
Author: Sumanth Chinthagunta <[email protected]>
Date:   Fri Jun 25 10:21:54 2021 -0700

    build(deps): updated kotlin to 1.5.20

commit 40617051cc4b3dbeb97f8730defd87f99d8afb95
Author: Sumanth Chinthagunta <[email protected]>
Date:   Fri Jun 25 07:37:02 2021 -0700

    feat(gradle): adding affected custom tas

from affectedmoduledetector.

xmlking avatar xmlking commented on July 22, 2024

I tried this, but tests still executed. I have affectedTestConfiguration { jvmTestTask = "check" } in each sub project

gradle runAffectedUnitTests -Paffected_module_detector.enable -Paffected_module_detector.changedProjects

Output

[INFO] [amd] Modules provided: null
[INFO] [amd] Using real detector with CHANGED_PROJECTS
[INFO] [amd] running command git rev-parse develop in /Users/schintha/Developer/Work/java/micro-apps
[INFO] [amd] Response: 4c3ba5885d9062d32704012ebd1f1a137fd892e9

[INFO] [amd] running command git --no-pager diff --name-only 4c3ba5885d9062d32704012ebd1f1a137fd892e9 in /Users/schintha/Developer/Work/java/micro-apps
[INFO] [amd] Response: 
[INFO] [amd] checking whether I should include :apps:account-service and my answer is false
[INFO] [amd] checking whether I should include :apps:chat-service and my answer is false
[INFO] [amd] checking whether I should include :apps:classifier-pipeline and my answer is false
[INFO] [amd] checking whether I should include :apps:entity-service and my answer is false
[INFO] [amd] checking whether I should include :apps:greeting-service and my answer is false
[INFO] [amd] checking whether I should include :apps:ingestion-pipeline and my answer is false
[INFO] [amd] checking whether I should include :apps:keying-service and my answer is false
[INFO] [amd] checking whether I should include :apps:linking-service and my answer is false
[INFO] [amd] checking whether I should include :apps:person-service and my answer is false
[INFO] [amd] checking whether I should include :apps:wordcount-pipeline and my answer is false
[INFO] [amd] checking whether I should include :libs:core and my answer is false
[INFO] [amd] checking whether I should include :libs:kbeam and my answer is false
[INFO] [amd] checking whether I should include :libs:model and my answer is false
[INFO] [amd] checking whether I should include :libs:pipeline and my answer is false
[INFO] [amd] checking whether I should include :libs:proto and my answer is false
[INFO] [amd] checking whether I should include :libs:service and my answer is false
[INFO] [amd] checking whether I should include :libs:test and my answer is false

from affectedmoduledetector.

GianfrancoMS avatar GianfrancoMS commented on July 22, 2024

I have the same problem. runAffectedUnitTests is running all tests

from affectedmoduledetector.

GianfrancoMS avatar GianfrancoMS commented on July 22, 2024

Did you find a solution?

from affectedmoduledetector.

joshafeinberg avatar joshafeinberg commented on July 22, 2024

Hello @xmlking - can you please test with the latest version of the library. we have resolved a lot of the bugs so hopefully this issue has been fixed. Otherwise feel free to reopen this issue and we can debug a bit more :)

from affectedmoduledetector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.