#780 blockerbugs: define BLOCKERBUGS_URL and simplify the config file
Merged 2 years ago by frantisekz. Opened 2 years ago by kparal.
fedora-infra/ kparal/ansible blockerbugs-192  into  main

@@ -28,9 +28,12 @@ 

  host_group: blockerbugs

  

  blockerbugs_secret_key: "{{ stg_blockerbugs_secret_key }}"

+ blockerbugs_url: 'https://qa.fedoraproject.org/blockerbugs/'

  blockerbugs_bugzilla_url: 'https://bugzilla.redhat.com/'

  blockerbugs_bodhi_url: 'https://bodhi.fedoraproject.org/'

- blockerbugs_koji_url: "http://koji.fedoraproject.org/"

+ blockerbugs_pagure_url: 'https://pagure.io/'

+ blockerbugs_pagure_repo_token_secret: "{{ blockerbugs_pagure_repo_token }}"

+ blockerbugs_pagure_repo_webhook_key_secret: "{{ blockerbugs_pagure_repo_webhook_key }}"

  

  ############################################################

  # blockerbugs db details
@@ -43,4 +46,3 @@ 

  # these aren't right but they're just placeholders for now

  blockerbugs_db_user: "{{ prod_blockerbugs_db_user }}"

  blockerbugs_db_password: "{{ prod_blockerbugs_db_password }}"

- 

@@ -25,13 +25,12 @@ 

  master_blockerbugs_node: False

  

  blockerbugs_secret_key: "{{ stg_blockerbugs_secret_key }}"

- 

- blockerbugs_bugzilla_url: 'https://bugzilla.redhat.com/'

- blockerbugs_bodhi_url: 'https://bodhi.fedoraproject.org/'

- blockerbugs_koji_url: "http://koji.fedoraproject.org/"

- # these are to use stg stuff but that often doesn't work well

- #blockerbugs_bugzilla_url: 'https://bugzilla.stage.redhat.com/'

- #blockerbugs_bodhi_url: 'https://bodhi.stg.fedoraproject.org/'

+ blockerbugs_url: 'https://qa.stg.fedoraproject.org/blockerbugs/'

+ blockerbugs_bugzilla_url: 'https://bugzilla.stage.redhat.com/'

+ blockerbugs_bodhi_url: 'https://bodhi.stg.fedoraproject.org/'

+ blockerbugs_pagure_url: 'https://stg.pagure.io/'

+ blockerbugs_pagure_repo_token_secret: "{{ blockerbugs_stg_pagure_repo_token }}"

+ blockerbugs_pagure_repo_webhook_key_secret: "{{ blockerbugs_stg_pagure_repo_webhook_key }}"

  

  ############################################################

  # blockerbugs db details
@@ -43,4 +42,3 @@ 

  blockerbugs_db_name: blockerbugs

  blockerbugs_db_user: "{{ stg_blockerbugs_db_user }}"

  blockerbugs_db_password: "{{ stg_blockerbugs_db_password }}"

- 

@@ -3,21 +3,26 @@ 

  FAS_ADMIN_GROUP = "qa-admin"

  FAS_USER = "{{ blockerbugs_fas_user }}@fedoraproject.org"

  FAS_PASSWORD = "{{ blockerbugs_fas_password }}"

+ BUGZILLA_URL = '{{ blockerbugs_bugzilla_url }}'

+ BUGZILLA_XMLRPC = BUGZILLA_URL + 'xmlrpc.cgi'

+ BODHI_URL = '{{ blockerbugs_bodhi_url }}'

+ BLOCKERBUGS_URL = '{{ blockerbugs_url }}'

+ BLOCKERBUGS_API = "{}api/v0/".format(BLOCKERBUGS_URL)

+ PAGURE_URL = '{{ blockerbugs_pagure_url }}'

+ PAGURE_API = PAGURE_URL + '/api/0/'

+ PAGURE_REPO_TOKEN = "{{ blockerbugs_pagure_repo_token_secret }}"

+ PAGURE_REPO_WEBHOOK_KEY = "{{ blockerbugs_pagure_repo_webhook_key_secret }}"

+ PAGURE_REPO = "fedora-qa/blocker-review"

+ PAGURE_BOT_USERNAME = 'blockerbot'

+ 

  {% if env == "staging" %}

  FAS_FLASK_COOKIE_REQUIRES_HTTPS = False

  FAS_CHECK_CERT = False

  PRODUCTION = False

  FAS_ENABLED = True

  SQLALCHEMY_TRACK_MODIFICATIONS = False

- BUGZILLA_URL = 'https://bugzilla.stage.redhat.com/'

- BODHI_URL = 'https://bodhi.stg.fedoraproject.org/'

- KOJI_URL = 'https://bugzilla.stage.redhat.com/'

- {% else %}

- BUGZILLA_URL = '{{ blockerbugs_bugzilla_url }}'

- BODHI_URL = '{{ blockerbugs_bodhi_url }}'

- KOJI_URL = "{{ blockerbugs_bugzilla_url }}"

  {% endif %}

- BUGZILLA_XMLRPC = BUGZILLA_URL + 'xmlrpc.cgi'

+ 

  FILE_LOGGING = False

  SYSLOG_LOGGING = True

  STREAM_LOGGING = True
@@ -37,17 +42,3 @@ 

  # enable fedmenu

  FEDMENU_URL = 'https://apps.fedoraproject.org/fedmenu/'

  FEDMENU_DATA_URL = 'https://apps.fedoraproject.org/js/data.js'

- 

- {% if env == "staging" %}

- PAGURE_URL = "https://stg.pagure.io/"

- PAGURE_API = "https://stg.pagure.io/api/0/"

- PAGURE_REPO_TOKEN = "{{ blockerbugs_stg_pagure_repo_token }}"

- PAGURE_REPO_WEBHOOK_KEY = "{{ blockerbugs_stg_pagure_repo_webhook_key }}"

- {% else %}

- PAGURE_URL = "https://pagure.io/"

- PAGURE_API = "https://pagure.io/api/0/"

- PAGURE_REPO_TOKEN = "{{ blockerbugs_pagure_repo_token }}"

- PAGURE_REPO_WEBHOOK_KEY = "{{ blockerbugs_pagure_repo_webhook_key }}"

- {% endif %}

- PAGURE_REPO = "fedora-qa/blocker-review"

- PAGURE_BOT_USERNAME = 'blockerbot'

BLOCKERBUGS_URL needs to be defined in order to show correct links in the
staging environment. While fixing that, realized that most of the if-else
clauses were unnecessary, because there are already group vars for that. So
simplified the config file by using the vars. KOJI_URL is dropped because it's
no longer needed.

Related: https://pagure.io/fedora-qa/blockerbugs/issue/192


@tflink Can you please review this? (@frantisekz is on PTO right now). Thanks!
This doesn't need a freeze exception, it can wait until the Beta freeze is lifted.
PS: I noticed that group_vars/blockerbugs (production) contains blockerbugs_secret_key: "{{ stg_blockerbugs_secret_key }}" (the stg secret), I'm not sure if that's intentional/correct.

Metadata Update from @kparal:
- Request assigned

2 years ago

Metadata Update from @kparal:
- Request assigned

2 years ago

Seems alright to me, nice and clean with those group_vars :)

Great. Can you please merge this (and run the playbooks) once the freeze is lifted? Thanks!

rebased onto b00d1d2

2 years ago

Pull-Request has been merged by frantisekz

2 years ago