#2558 web: disable links to deleted tags
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue2543  into  master

@@ -249,8 +249,7 @@ 

          server = self.__get_server(task)

          self.get_server.return_value = server

          webidx.taskinfo(self.environ, self.task_id)

-         server.getTag.assert_not_called()

-         self.assertEqual(self.environ['koji.values']['buildTag'], 'testBuildMaven')

+         server.getTag.assert_called_with('testBuildMaven', strict=True)

  

          # case 3. buildSRPMFromSCM

          task = copy.deepcopy(self.task)

file modified
+3 -11
@@ -651,20 +651,12 @@ 

      buildroots = server.listBuildroots(taskID=task['id'])

      values['buildroots'] = buildroots

  

-     if task['method'] == 'buildArch':

-         try:

-             values['buildTag'] = server.getTag(params[1], strict=True)['name']

-         except koji.GenericError:

-             values['buildTag'] = "%d (deleted)" % params[1]

-     elif task['method'] == 'buildMaven':

-         buildTag = params[1]

-         values['buildTag'] = buildTag

-     elif task['method'] == 'buildSRPMFromSCM':

+     if task['method'] in ('buildArch', 'buildMaven', 'buildSRPMFromSCM'):

          if len(params) > 1:

              try:

-                 values['buildTag'] = server.getTag(params[1], strict=True)['name']

+                 values['buildTag'] = server.getTag(params[1], strict=True)

              except koji.GenericError:

-                 values['buildTag'] = "%d (deleted)" % params[1]

+                 values['buildTag'] = {'name': "%d (deleted)" % params[1], 'id': None}

      elif task['method'] == 'tagBuild':

          destTag = server.getTag(params[0])

          build = server.getBuild(params[1])

@@ -38,7 +38,13 @@ 

  #if $task.method == 'buildSRPMFromSCM'

  <strong>SCM URL:</strong> $params[0]<br/>

  #if $len($params) > 1

- <strong>Build Tag:</strong> <a href="taginfo?tagID=$quote($buildTag)">$buildTag</a><br/>

+ <strong>Build Tag:</strong>

+ #if $buildTag.id

+ <a href="taginfo?tagID=$buildTag.id">$buildTag.name</a>

+ #else

+ $buildTag.name

+ #end if

+ <br/>

  #end if

  #if $len($params) > 2

  $printOpts($params[2])
@@ -47,7 +53,13 @@ 

  <strong>CVS URL:</strong> $params[0]

  #elif $task.method == 'buildArch'

  <strong>SRPM:</strong> $params[0]<br/>

- <strong>Build Tag:</strong> <a href="taginfo?tagID=$quote($buildTag)">$buildTag</a><br/>

+ <strong>Build Tag:</strong>

+ #if $buildTag.id

+ <a href="taginfo?tagID=$buildTag.id">$buildTag.name</a>

+ #else

+ $buildTag.name

+ #end if

+ <br/>

  <strong>Arch:</strong> $params[2]<br/>

  <strong>Keep SRPM?</strong> #if $params[3] then 'yes' else 'no'#<br/>

  #if $len($params) > 4
@@ -92,7 +104,13 @@ 

  $printOpts($params[2])

  #elif $task.method == 'buildMaven'

  <strong>SCM URL:</strong> $params[0]<br/>

- <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag.id">$buildTag.name</a><br/>

+ <strong>Build Tag:</strong>

+ #if $buildTag.id

+ <a href="taginfo?tagID=$buildTag.id">$buildTag.name</a>

+ #else

+ $buildTag.name

+ #end if

+ <br/>

  #if $len($params) > 2

  $printOpts($params[2])

  #end if
@@ -100,7 +118,13 @@ 

  <strong>Spec File URL:</strong> $params[0]<br/>

  #if 'locked' in $buildTarget

  #set $buildTag = $buildTarget.name

- <strong>Build Tag:</strong> <a href="taginfo?tagID=$quote($buildTag)">$buildTag</a><br/>

+ <strong>Build Tag:</strong>

+ #if $buildTag.id

+ <a href="taginfo?tagID=$buildTag.id">$buildTag.name</a>

+ #else

+ $buildTag.name

+ #end if

+ <br/>

  #else

  <strong>Build Target:</strong> <a href="buildtargetinfo?targetID=$buildTarget.id">$buildTarget.name</a><br/>

  #end if

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

1 new commit added

  • fix EOL
2 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

2 years ago

rebased onto 694c2c8

2 years ago

pretty please pagure-ci rebuild

2 years ago

1 new commit added

  • fix test
2 years ago

Commit 97c4084 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago