jfrog / terraform-provider-xray

Terraform provider to manage JFrog Xray
https://jfrog.com/xray/
Apache License 2.0
149 stars 12 forks source link

Behavior of "all-repos" and "all-builds" when using project_key #115

Closed oallauddin closed 1 year ago

oallauddin commented 1 year ago

This is more of question than an issue. Just want to confirm my understanding of the behavior of a watch when providing a project key. When using all-repos and all-builds based watch with a project_key means that the watch will watch all of the builds and all of the repos for the project? It will not watch any builds or repos outside of the project? If someone setup an all-repos and an all-builds watch without setting a project_key then the watch would watch every build and every repos in Artifactory?

resource "xray_watch" "alpha_security_watch" {
  name        = "alpha-security-watch"
  description = "Alpha Security Watch"
  active      = true
  project_key = "alpha"

  watch_resource {
    type = "all-repos"
  }

  watch_resource {
    type = "all-builds"

    ant_filter {
      include_patterns = ["**ALPHA**", "**alpha**"]
    }
  }

  assigned_policy {
    name = xray_security_policy.security_policy.name
    type = "security"
  }

  watch_recipients = []

  depends_on = [
    project.alpha_project,
    xray_security_policy.alpha_security_policy
  ]
}
danielmkn commented 1 year ago

Hi @oallauddin! If you create a watch in the project with all-repos and/or all-builds set, it will only work for the repos or builds assigned to that project.

It will not watch any builds or repos outside of the project?

It will not.

If someone setup an all-repos and an all-builds watch without setting a project_key then the watch would watch every build and every repos in Artifactory?

Yes.