#945 frontend: better link to builder-live.log
Merged 4 years ago by praiskup. Opened 4 years ago by thrnciar.
copr/ thrnciar/copr builder-live-log-link  into  master

@@ -905,7 +905,9 @@ 

      @property

      def import_log_url_backend(self):

          parts = ["results", self.copr.owner_name, self.copr_dirname,

-                  "srpm-builds", self.id_fixed_width, "builder-live.log"]

+                  "srpm-builds", self.id_fixed_width,

+                  "builder-live.log" if self.source_status == StatusEnum("running") 

+                                     else "builder-live.log.gz"]

          path = os.path.normpath(os.path.join(*parts))

          return urljoin(app.config["BACKEND_BASE_URL"], path)

  

@@ -164,12 +164,15 @@ 

          <dl class="dl-horizontal">

          {{ describe_failure(build) }}

          <dt>SRPM build log:</dt>

-         <dd>

+           {% if build.source_status | state_from_num in ['pending', 'starting']  %}

+             <dd> Build has not started yet </dd>

+           {% endif %}

            {% for url in build.get_import_log_urls(g.user.admin) %}

-             <a href="{{ url }}">{{ url |basename }}</a>

-             {{ "," if not loop.last }}

+             <dd>

+               <a href="{{ url }}">{{ url | basename }}</a>

+                 {{ "," if not loop.last }}

+             </dd>

            {% endfor %}

-         </dd>

          <dt> Built Packages:</dt>

          {% if build.built_packages %}

            {% for pkg in build.built_packages.split("\n"): %}

show builder-log.gz instead of builder-log on build page when build has finished
and hide if it is still running

fixes #941

I thought that we have six different states and the URL should be shown only for failure and succes.

class BuildStatus(object): FAILURE = 0 SUCCEEDED = 1 RUNNING = 3 PENDING = 4 SKIPPED = 5 STARTING = 6

no, I removed it for myself and forgot to add it back

rebased onto 4ff938cfd7a3ace3170833e5c1176fa216e40af8

4 years ago

I think this is always true :-) 0 != 1, 1 != 0 and anything else x != 1 && x != 0.

rebased onto 02f591a0673860bde9d20643da06ceeb4df49e8e

4 years ago

Could we still show builder-live.log when the build is running?

rebased onto 16cafcd00e7c46d6eff7de5e7678a63fffd25da1

4 years ago

Ugh. I'm so sorry for making confusion ... I tried your patch locally, and you should probably work with build.source_status only here (we only generate builder-live.log* links for source RPMs now.

rebased onto 639b7c158116073b0fc77b336d19e8f610cf0917

4 years ago

rebased onto aed1e4949add35a21d58a35c68a29bb43a93b218

4 years ago

What if we looked at the state here, and returned *.log.gz for self.source_status in FINISHED_STATUSES?

If we made the get_import_log_urls urls to return None (when there's no log, yet) we could avoid the complicated if here.

rebased onto e5f8ee00de503131952093a5e61a315f210af5bd

4 years ago

rebased onto 18bdb8cf0b352a17ad859dbc28109688e63aa18f

4 years ago

The self.source_status is numeric, you need to use StatusEnum

rebased onto 59ba10c9ed2885bee9ac6761aaa940bbd43ae2dd

4 years ago

rebased onto 727a494e8cd09f997e894287ec925a3b77dcc371

4 years ago

can you please move the text 2bytes left?

otherwise looks good, thanks

rebased onto a2b1ac747b2dfae52c84c6547437fe497d63a490

4 years ago

rebased onto 898420f

4 years ago

Metadata Update from @praiskup:
- Pull-request tagged with: can-be-merged

4 years ago

Commit 4aa9324 fixes this pull-request

Pull-Request has been merged by praiskup

4 years ago