diff --git a/.github/workflows/workflow-tester.yml b/.github/workflows/workflow-tester.yml index 6b85f461..7a947fd9 100644 --- a/.github/workflows/workflow-tester.yml +++ b/.github/workflows/workflow-tester.yml @@ -91,8 +91,8 @@ jobs: needs: [ bump-check, build, tests-and-sonarqube ] runs-on: ubuntu-latest steps: - - name: "Notify WSM Slack" - # post to WSM Slack when a regular push (i.e. non-bumper push) is made to main branch + - name: "Notify Teaspoons Slack" + # post to Teaspoons Slack when a regular push (i.e. non-bumper push) is made to main branch if: always() && github.event_name == 'push' && needs.bump-check.outputs.is-bump == 'no' uses: broadinstitute/action-slack@v3.8.0 # see https://github.com/broadinstitute/action-slack diff --git a/service/src/main/java/bio/terra/pipelines/db/entities/PipelineQuota.java b/service/src/main/java/bio/terra/pipelines/db/entities/PipelineQuota.java new file mode 100644 index 00000000..c89ccede --- /dev/null +++ b/service/src/main/java/bio/terra/pipelines/db/entities/PipelineQuota.java @@ -0,0 +1,30 @@ +package bio.terra.pipelines.db.entities; + +import bio.terra.pipelines.common.utils.PipelinesEnum; +import jakarta.persistence.*; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Entity +@Getter +@Setter +@NoArgsConstructor +@Table(name = "pipeline_quotas") +public class PipelineQuota { + @Id + @Column(name = "id", nullable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "pipeline_name", nullable = false) + private PipelinesEnum pipelineName; + + @Column(name = "default_quota") + private Long defaultQuota; + + public PipelineQuota(PipelinesEnum pipelineName, Long defaultQuota) { + this.pipelineName = pipelineName; + this.defaultQuota = defaultQuota; + } +} diff --git a/service/src/main/java/bio/terra/pipelines/db/repositories/PipelineQuotasRepository.java b/service/src/main/java/bio/terra/pipelines/db/repositories/PipelineQuotasRepository.java new file mode 100644 index 00000000..05940bb9 --- /dev/null +++ b/service/src/main/java/bio/terra/pipelines/db/repositories/PipelineQuotasRepository.java @@ -0,0 +1,9 @@ +package bio.terra.pipelines.db.repositories; + +import bio.terra.pipelines.common.utils.PipelinesEnum; +import bio.terra.pipelines.db.entities.PipelineQuota; +import org.springframework.data.repository.CrudRepository; + +public interface PipelineQuotasRepository extends CrudRepository { + PipelineQuota findByPipelineName(PipelinesEnum pipelineName); +} diff --git a/service/src/main/resources/db/changelog.xml b/service/src/main/resources/db/changelog.xml index cca113c0..4b625451 100644 --- a/service/src/main/resources/db/changelog.xml +++ b/service/src/main/resources/db/changelog.xml @@ -29,6 +29,7 @@ + diff --git a/service/src/main/resources/db/changesets/20241030_add_pipeline_quotas.yaml b/service/src/main/resources/db/changesets/20241030_add_pipeline_quotas.yaml new file mode 100644 index 00000000..6779b860 --- /dev/null +++ b/service/src/main/resources/db/changesets/20241030_add_pipeline_quotas.yaml @@ -0,0 +1,38 @@ +databaseChangeLog: + - changeSet: + id: add pipeline quotas table + author: ks + changes: + # add pipeline_quotas table + - createTable: + tableName: pipeline_quotas + remarks: | + this table describes the quota allowed per pipeline + columns: + - column: + name: id + type: serial + constraints: + primaryKey: true + nullable: false + - column: + name: pipeline_name + type: text + constraints: + nullable: false + unique: true + - column: + name: default_quota + type: int + constraints: + nullable: false + # add default quota for imputation_beagle to pipeline_quotas table + - insert: + tableName: pipeline_quotas + columns: + - column: + name: pipeline_name + value: imputation_beagle + - column: + name: default_quota + value: 10000