#66 Use pagure commit flag API
Merged 3 years ago by pingou. Opened 3 years ago by zlopez.
fedora-infra/ zlopez/toddlers flag_ci_pr_api_update  into  main

@@ -143,7 +143,8 @@ 

  

          pr_id = str(msg["artifact"]["id"])

  

-         commit_hash_text = " for %s" % msg["artifact"]["commit_hash"][:8]

+         commit_hash = msg["artifact"]["commit_hash"]

+         commit_hash_text = " for %s" % commit_hash[:8]

          seed = config.get("dist_git_token_seed", config.get("pagure_token_seed")) or ""

  

          data = {
@@ -161,9 +162,7 @@ 

          namespace = msg["artifact"]["repository"].split("/")[-2]

          repo = msg["artifact"]["repository"].split("/")[-1]

  

-         target_url = "/".join(

-             ["api", "0", namespace, repo, "pull-request", pr_id, "flag"]

-         )

+         target_url = "/".join(["api", "0", namespace, repo, "c", commit_hash, "flag"])

          flag_url = dist_git_url + "/" + target_url

          _log.info("Flagging commit at: %s" % flag_url)

  

Instead of flagging the whole PR, flag only tested commit.

Signed-off-by: Michal Konečný mkonecny@redhat.com

Build succeeded.

  • tox : SUCCESS in 6m 15s

rebased onto 2f44b04091779a18683e1c14bf079f0cedb6c54d

3 years ago

nice and easy, I'm surprised you did not have to change any tests though

Build succeeded.

  • tox : SUCCESS in 9m 23s

nice and easy, I'm surprised you did not have to change any tests though

I was surprised too, but none of the tests is actually validating the request to pagure only the result after response.

rebased onto b0e282a

3 years ago

Let's get this in, now that the new pagure has been deployed

Pull-Request has been merged by pingou

3 years ago

Build succeeded.

  • tox : SUCCESS in 6m 12s