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

Project key with hyphen support #75

Closed
oallauddin opened this issue Aug 29, 2022 · 2 comments
Closed

Project key with hyphen support #75

oallauddin opened this issue Aug 29, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@oallauddin
Copy link

Describe the bug
Project key with a hyphen is throwing an error.

@alexhung I am testing jfrog/terraform-provider-shared#21.
The project provider does not have an issue with a project key with a hyphen.
The xray provider does not like it and throws a 500 error on the terraform apply.

500 POST https://artifactory-server.com/xray/api/v2/policies?projectKey=tst-test
{"error":"Failed to create Policy"}

Requirements for and issue

resource "project" "tst_project" {
  key          = "tst-test"
  display_name = "Test Project"

  admin_privileges {
    manage_members   = true
    manage_resources = true
    index_resources  = true
  }
  
}


resource "xray_security_policy" "tst_security_policy" {
  name        = "tst-security-policy"
  description = "Test Security Policy"
  type        = "security"
  project_key = "tst-test"

  rule {
    name     = "tst-severity-rule"
    priority = 1

    criteria {
      cvss_range {
        from = 7.0
        to   = 10.0
      }
    }

    actions {
      webhooks                          = []
      mails                             = []
      block_release_bundle_distribution = false
      fail_build                        = false
      notify_watch_recipients           = false
      notify_deployer                   = false
      create_ticket_enabled             = false // set to true only if Jira integration is enabled
      //build_failure_grace_period_in_days = 5     // use only if fail_build is enabled

      block_download {
        unscanned = false
        active    = false
      }
    }
  }

  depends_on = [
    project.tst_project
  ]
}

Expected behavior
Project key with a hyphen does not cause an error.

@oallauddin oallauddin added the bug Something isn't working label Aug 29, 2022
@alexhung
Copy link
Member

@oallauddin Which version of the xray provider are you using?

Version 1.5.1 is updated with the new hyphen support.

@oallauddin
Copy link
Author

@alexhung
Looks like issue is with my version of Artifactory and Xray.
I see you tested on newer versions than what we have setup.
I will ask our admins when they plan to upgrade Artifactory and Xray.

Versions
Artifactory version: 7.35.2
Xray version: 3.32.2
Terraform version: 1.2.5
Xray Provider version: 1.5.1
Project Provider version: 1.1.6
Artifactory Provider: 6.14.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants