8000 Renumbering Database rules so it's easier to override by agoncal · Pull Request #978 · windup/windup-rulesets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Renumbering Database rules so it's easier to override #978

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

Merged
merged 5 commits into from
Jun 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions rules/rules-reviewed/technology-usage/database.windup.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ static void perform(GraphRewrite event, EvaluationContext context, FileModel fil
technologyTagService.addTagToFileModel(fileModel, "$technology", TechnologyTagLevel.INFORMATIONAL)
}

// this is inherited from previous version of these rules (i.e. XML rules)
// in order to keep consistency with tests already available
int id = 14;
// This is inherited from previous version of these rules (i.e. XML rules)
// in order to keep consistency with tests already available we start numbering from 14

ruleSet("database")
.addRule()
Expand All @@ -49,39 +48,39 @@ ruleSet("database")
perform(event, context, payload.getFile(), "HSQLDB Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-01400")
.addRule()
.when(File.inFileNamed("{*}mysql-connector{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "MySQL Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-01500")
.addRule()
.when(File.inFileNamed("{*}derby{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "Derby Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-01600")
.addRule()
.when(File.inFileNamed("{*}postgresql{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "PostgreSQL Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-01700")
.addRule()
.when(File.inFileNamed("{*}h2{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "H2 Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-01800")
.addRule()
.when(Or.any(
File.inFileNamed("sqljdbc{*}.jar"),
Expand All @@ -93,15 +92,15 @@ ruleSet("database")
perform(event, context, payload.getFile(), "Microsoft SQL Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-01900")
.addRule()
.when(File.inFileNamed("{*}sqlite-jdbc{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "SQLite Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02000")
// http://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html
.addRule()
.when(Or.any(
Expand All @@ -114,7 +113,7 @@ ruleSet("database")
perform(event, context, payload.getFile(), "Oracle DB Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02100")
// https://mvnrepository.com/open-source/cassandra-clients
.addRule()
.when(Or.any(
Expand All @@ -133,23 +132,23 @@ ruleSet("database")
perform(event, context, payload.getFile(), "Cassandra Client", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02200")
.addRule()
.when(File.inFileNamed("{*}axion{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "Axion Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02300")
.addRule()
.when(File.inFileNamed("{*}mckoisqldb{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "MckoiSQLDB Driver", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02400")
// https://mvnrepository.com/open-source/mongodb-clients
.addRule()
.when(Or.any(
Expand All @@ -166,7 +165,7 @@ ruleSet("database")
perform(event, context, payload.getFile(), "MongoDB Client", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02500")
.addRule()
.when(File.inFileNamed("spring-data{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
Expand All @@ -185,7 +184,7 @@ ruleSet("database")
technologyTagService.addTagToFileModel(payload.getFile(), "Spring Data", TechnologyTagLevel.INFORMATIONAL)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02600")
.addRule()
.when(File.inFileNamed("{*}morphia{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
Expand All @@ -203,31 +202,31 @@ ruleSet("database")
technologyTagService.addTagToFileModel(payload.getFile(), "Morphia", TechnologyTagLevel.INFORMATIONAL)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02700")
.addRule()
.when(File.inFileNamed("{*}leveldb{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "LevelDB Client", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02800")
.addRule()
.when(File.inFileNamed("{*}hbase{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "Apache HBase Client", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-02900")
.addRule()
.when(File.inFileNamed("{*}accumulo{*}.jar"))
.perform(new AbstractIterationOperation<FileLocationModel>() {
void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) {
perform(event, context, payload.getFile(), "Apache Accumulo Client", true)
}
})
.withId(String.format("database-0%d00", id++))
.withId("database-03000")
.addRule()
.when(Or.any(
Project.dependsOnArtifact(Artifact.withGroupId("org.springframework.data").andArtifactId("spring-data-jpa")),
Expand All @@ -247,4 +246,4 @@ ruleSet("database")
technologyTagService.addTagToFileModel(payload.getFile(), "Spring Data JPA", TechnologyTagLevel.INFORMATIONAL)
}
})
.withId(String.format("database-0%d00", id))
.withId("database-03100")
0