<commit_before>            <?python
                histassignments = None
                #import logging
                #log = logging.getLogger(__name__)
            ?>
<div metal:use-macro="layout">
  <div metal:fill-slot="content">
    <div>

      <div tal:condition="not denied and commit == 'true'">
        <p id="promote">
        <table width="100%">
          <tr class="subh">
            <td class="subh">Success!</td>
            <td colspan="8" tal:attributes="class '%s' % to_env" tal:condition="to_state == '3'" tal:content="'Successfully staged artifact id to %s: %s' % (to_env, artifact_id)">0</td>
            <td colspan="8" tal:attributes="class '%s' % to_env" tal:condition="to_state != '3'" tal:content="'Successfully promoted artifact id to %s: %s' % (to_env, artifact_id)">0</td>
          </tr>
        </table>
        </p>
      </div>

      <div tal:condition="nodegroup">
        <p>

        <h1 tal:content="'Deployment summary by env for ' + nodegroup.upper()">Deployment summary by environment</h1>

        </p>
        <table width="100%" tal:condition="(application_id or nodegroup)">
          <tr class="subh">
            <td class="subh">Node Group</td>
            <td class="subh_app" colspan="10" tal:content="nodegroup.upper() + ' (' + application_id + ')'">tct</td>
          </tr>
          <tr>
            <th>Deploy Path</th>
            <th>Revision</th>
            <th>Branch/Tag</th>
            <th>Repo</th>
            <th>Artifact Type</th>
            <th>URL Location</th>
            <th>Artifact ID</th>
            <th>Assignment ID</th>
            <th>Assignment Date</th>
            <th>Promoted By</th>
            <th>History</th>
          </tr>

          <tbody tal:repeat="denv ['prd','qat','dev']" tal:condition="app">
          <tr tal:attributes="class denv" tal:condition="app">
            <td colspan="11"><b tal:content="denv.upper()">DEV</b></td>
          </tr>
          <tr tal:repeat="item app.deploys">
            <?python
                aa = item.get_assignment(denv)
                if ((deploy_id) and int(deploy_id) == item.deploy_id) and (env is not None):
                    histassignments = item.get_assignments(env, offset, perpage)
                    histdeploy = item
                    total = item.get_assignment_count(env)
            ?>
            <td tal:content="item.deploy_path" tal:attributes="title 'Deploy ID: ' + str(item.deploy_id)">/app/something</td>
            <td tal:content="aa.artifact.revision[:8] if aa else 'No Data'">12345</td>
            <td tal:content="aa.artifact.branch if aa else 'No Data'">trunk</td>
            <td tal:content="aa.artifact.repo.name if aa else 'No Data'">12345</td>
            <td tal:content="item.type.name">12345</td>
            <td tal:condition="not aa">No Data</td>
            <td tal:condition="aa"><a href="http://code.ctgrd.com/my/awesome/artifact.war"
                   title="some description"
                   tal:attributes="href aa.pretty_url; title aa.pretty_url"
                   tal:content="aa.artifact.location.split('/')[-1]">Artifacts By nodegroupLink</a></td>
            <td tal:content="aa.artifact_id if aa else 'No Data'">12345</td>
            <td tal:content="aa.artifact_assignment_id if aa else 'No Data'">12345</td>
            <td tal:content="aa.created if aa else 'No Data'">12345</td>
            <td tal:content="aa.user if aa else 'No Data'">12345</td>
            <td tal:condition="not aa">No Data</td>
            <td tal:condition="aa"><a href="http://twonicorn.ctgrd.com/deploys?history=true"
                   title="Show History"
                   tal:attributes="href '/deploys?history=true&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s' %
                                        (item.deploy_id,
                                         aa.env.name,
                                         application_id,
                                         nodegroup
                                        );
                                   title 'Show history for deploy id: ' + str(item.deploy_id)"
                   tal:content="'Show History'">show history</a></td>
          </tr>
          </tbody>
        </table>
      </div>

      <p>
      <div tal:condition="histassignments" id="history_main">
        <div id="results_nav">
          <!!-- Results navigation -->
          <a class="nb_disable" disabled tal:condition="offset == 0"><img src='/static/nav-le.gif' border='0'></a>
          <a class="nb_disable" disabled tal:condition="offset == 0"><img src='/static/nav-l.gif' border='0'></a>
          <a class="nb" tal:condition="offset &gt; 0" tal:attributes="href '?history=%s&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s&start=0' % (history,deploy_id,env,application_id,nodegroup)"><img src='/static/nav-le.gif' border='0'></a>
          <a class="nb" tal:condition="offset &gt; 0" tal:attributes="href '?history=%s&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s&start=%d' % (history,deploy_id,env,application_id,nodegroup,offset-perpage)"><img src='/static/nav-l.gif' border='0'></a>
          <span tal:content="'%d-%d of %d' % (offset+1, min((offset+perpage),total), total)">
            11-20 of 123
          </span>
          <a class="nb" tal:condition="(offset+perpage) &lt; total" tal:attributes="href '?history=%s&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s&start=%d' % (history,deploy_id,env,application_id,nodegroup,offset+perpage)"><img src='/static/nav-r.gif' border='0'></a>
          <a class="nb" tal:condition="(offset+perpage) &lt; total" tal:attributes="href '?history=%s&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s&start=%d' % (history,deploy_id,env,application_id,nodegroup,(total-1)/perpage*perpage)"><img src='/static/nav-re.gif' border='0'></a>
          <a class="nb_disable" tal:condition="(offset+perpage) &gt;= total"><img src='/static/nav-r.gif' border='0'></a>
          <a class="nb_disable" tal:condition="(offset+perpage) &gt;= total" disabled><img src='/static/nav-re.gif' border='0'></a>
        </div>

        <div id="history_results">
          <table width="100%">
            <tr>
              <td class="subh">Deployment History</td>
              <td class="env" colspan="10" tal:attributes="class '%s' % env ; title 'Env: ' + env.upper() + ' Deploy ID:' + deploy_id" tal:content="env.upper() + ' (' + deploy_id + ')'">env</td>
            </tr>
            <tr>
              <th>Deploy Path</th>
              <th>Revision</th>
              <th>Branch/Tag</th>
              <th>Repo</th>
              <th>Artifact Type</th>
              <th>URL Location</th>
              <th>Artifact ID</th>
              <th>Assignment ID</th>
              <th>Assignment Date</th>
              <th></th>
            </tr>
      
            <tbody tal:repeat="item histassignments">
            <!--! Do some reformatting of the urls to make them useful -->
            <tr tal:attributes="class '%s' % env if repeat.item.even else 'white'">
              <td tal:content="histdeploy.deploy_path" tal:attributes="title 'Deploy ID: ' + str(item.deploy_id)">/app/something</td>
              <td tal:content="item.artifact.revision[:8]">12345</td>
              <td tal:content="item.artifact.branch">trunk</td>
              <td tal:content="item.artifact.repo.name">12345</td>
              <td tal:content="histdeploy.type.name">12345</td>
              <td><a href="http://code.ctgrd.com/my/awesome/artifact.war"
                     title="some description"
                     tal:attributes="href item.pretty_url; title item.pretty_url"
                     tal:content="item.artifact.location.split('/')[-1]">Artifacts By nodegroupLink</a></td>
              <td tal:content="item.artifact_id">0</td>
              <td tal:content="item.artifact_assignment_id">12345</td>
              <td tal:content="item.created">12345</td>
              <td>
                <ul tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                  <li tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                    Promote
                    <ul tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                      <li tal:condition="(not (env == 'dev' and repeat.item.start and offset == 0)) 
                                          and (not (histdeploy.type.name == 'conf' and (env == 'qat' or env == 'prd')))"
                          tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                        <a tal:attributes="href '/promote?deploy_id=%s&artifact_id=%s&to_env=dev&commit=false' %
                                                (item.deploy_id,
                                                 item.artifact_id,
                                                );
                                           title 'Promote to dev: ' + str(item.artifact_id)"
                           tal:content="'to dev'">promote to dev</a>
                      </li>
                      <li tal:condition="not (env == 'qat' and repeat.item.start and offset == 0) 
                                         and (not (histdeploy.type.name == 'conf' and (env == 'dev' or env == 'prd')))"
                          tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                        <a tal:attributes="href '/promote?deploy_id=%s&artifact_id=%s&to_env=qat&commit=false' %
                                                (item.deploy_id,
                                                 item.artifact_id,
                                                );
                                           title 'Promote to qat: ' + str(item.artifact_id)"
                           tal:content="'to qat'">promote to qat</a><commit_msg>adding user to history too<commit_after>            <?python
                histassignments = None
                #import logging
                #log = logging.getLogger(__name__)
            ?>
<div metal:use-macro="layout">
  <div metal:fill-slot="content">
    <div>

      <div tal:condition="not denied and commit == 'true'">
        <p id="promote">
        <table width="100%">
          <tr class="subh">
            <td class="subh">Success!</td>
            <td colspan="8" tal:attributes="class '%s' % to_env" tal:condition="to_state == '3'" tal:content="'Successfully staged artifact id to %s: %s' % (to_env, artifact_id)">0</td>
            <td colspan="8" tal:attributes="class '%s' % to_env" tal:condition="to_state != '3'" tal:content="'Successfully promoted artifact id to %s: %s' % (to_env, artifact_id)">0</td>
          </tr>
        </table>
        </p>
      </div>

      <div tal:condition="nodegroup">
        <p>

        <h1 tal:content="'Deployment summary by env for ' + nodegroup.upper()">Deployment summary by environment</h1>

        </p>
        <table width="100%" tal:condition="(application_id or nodegroup)">
          <tr class="subh">
            <td class="subh">Node Group</td>
            <td class="subh_app" colspan="10" tal:content="nodegroup.upper() + ' (' + application_id + ')'">tct</td>
          </tr>
          <tr>
            <th>Deploy Path</th>
            <th>Revision</th>
            <th>Branch/Tag</th>
            <th>Repo</th>
            <th>Artifact Type</th>
            <th>URL Location</th>
            <th>Artifact ID</th>
            <th>Assignment ID</th>
            <th>Assignment Date</th>
            <th>Promoted By</th>
            <th>History</th>
          </tr>

          <tbody tal:repeat="denv ['prd','qat','dev']" tal:condition="app">
          <tr tal:attributes="class denv" tal:condition="app">
            <td colspan="11"><b tal:content="denv.upper()">DEV</b></td>
          </tr>
          <tr tal:repeat="item app.deploys">
            <?python
                aa = item.get_assignment(denv)
                if ((deploy_id) and int(deploy_id) == item.deploy_id) and (env is not None):
                    histassignments = item.get_assignments(env, offset, perpage)
                    histdeploy = item
                    total = item.get_assignment_count(env)
            ?>
            <td tal:content="item.deploy_path" tal:attributes="title 'Deploy ID: ' + str(item.deploy_id)">/app/something</td>
            <td tal:content="aa.artifact.revision[:8] if aa else 'No Data'">12345</td>
            <td tal:content="aa.artifact.branch if aa else 'No Data'">trunk</td>
            <td tal:content="aa.artifact.repo.name if aa else 'No Data'">12345</td>
            <td tal:content="item.type.name">12345</td>
            <td tal:condition="not aa">No Data</td>
            <td tal:condition="aa"><a href="http://code.ctgrd.com/my/awesome/artifact.war"
                   title="some description"
                   tal:attributes="href aa.pretty_url; title aa.pretty_url"
                   tal:content="aa.artifact.location.split('/')[-1]">Artifacts By nodegroupLink</a></td>
            <td tal:content="aa.artifact_id if aa else 'No Data'">12345</td>
            <td tal:content="aa.artifact_assignment_id if aa else 'No Data'">12345</td>
            <td tal:content="aa.created if aa else 'No Data'">12345</td>
            <td tal:content="aa.user if aa else 'No Data'">12345</td>
            <td tal:condition="not aa">No Data</td>
            <td tal:condition="aa"><a href="http://twonicorn.ctgrd.com/deploys?history=true"
                   title="Show History"
                   tal:attributes="href '/deploys?history=true&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s' %
                                        (item.deploy_id,
                                         aa.env.name,
                                         application_id,
                                         nodegroup
                                        );
                                   title 'Show history for deploy id: ' + str(item.deploy_id)"
                   tal:content="'Show History'">show history</a></td>
          </tr>
          </tbody>
        </table>
      </div>

      <p>
      <div tal:condition="histassignments" id="history_main">
        <div id="results_nav">
          <!!-- Results navigation -->
          <a class="nb_disable" disabled tal:condition="offset == 0"><img src='/static/nav-le.gif' border='0'></a>
          <a class="nb_disable" disabled tal:condition="offset == 0"><img src='/static/nav-l.gif' border='0'></a>
          <a class="nb" tal:condition="offset &gt; 0" tal:attributes="href '?history=%s&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s&start=0' % (history,deploy_id,env,application_id,nodegroup)"><img src='/static/nav-le.gif' border='0'></a>
          <a class="nb" tal:condition="offset &gt; 0" tal:attributes="href '?history=%s&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s&start=%d' % (history,deploy_id,env,application_id,nodegroup,offset-perpage)"><img src='/static/nav-l.gif' border='0'></a>
          <span tal:content="'%d-%d of %d' % (offset+1, min((offset+perpage),total), total)">
            11-20 of 123
          </span>
          <a class="nb" tal:condition="(offset+perpage) &lt; total" tal:attributes="href '?history=%s&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s&start=%d' % (history,deploy_id,env,application_id,nodegroup,offset+perpage)"><img src='/static/nav-r.gif' border='0'></a>
          <a class="nb" tal:condition="(offset+perpage) &lt; total" tal:attributes="href '?history=%s&deploy_id=%s&env=%s&application_id=%s&nodegroup=%s&start=%d' % (history,deploy_id,env,application_id,nodegroup,(total-1)/perpage*perpage)"><img src='/static/nav-re.gif' border='0'></a>
          <a class="nb_disable" tal:condition="(offset+perpage) &gt;= total"><img src='/static/nav-r.gif' border='0'></a>
          <a class="nb_disable" tal:condition="(offset+perpage) &gt;= total" disabled><img src='/static/nav-re.gif' border='0'></a>
        </div>

        <div id="history_results">
          <table width="100%">
            <tr>
              <td class="subh">Deployment History</td>
              <td class="env" colspan="10" tal:attributes="class '%s' % env ; title 'Env: ' + env.upper() + ' Deploy ID:' + deploy_id" tal:content="env.upper() + ' (' + deploy_id + ')'">env</td>
            </tr>
            <tr>
              <th>Deploy Path</th>
              <th>Revision</th>
              <th>Branch/Tag</th>
              <th>Repo</th>
              <th>Artifact Type</th>
              <th>URL Location</th>
              <th>Artifact ID</th>
              <th>Assignment ID</th>
              <th>Assignment Date</th>
              <th>Promoted By</th>
              <th></th>
            </tr>
      
            <tbody tal:repeat="item histassignments">
            <!--! Do some reformatting of the urls to make them useful -->
            <tr tal:attributes="class '%s' % env if repeat.item.even else 'white'">
              <td tal:content="histdeploy.deploy_path" tal:attributes="title 'Deploy ID: ' + str(item.deploy_id)">/app/something</td>
              <td tal:content="item.artifact.revision[:8]">12345</td>
              <td tal:content="item.artifact.branch">trunk</td>
              <td tal:content="item.artifact.repo.name">12345</td>
              <td tal:content="histdeploy.type.name">12345</td>
              <td><a href="http://code.ctgrd.com/my/awesome/artifact.war"
                     title="some description"
                     tal:attributes="href item.pretty_url; title item.pretty_url"
                     tal:content="item.artifact.location.split('/')[-1]">Artifacts By nodegroupLink</a></td>
              <td tal:content="item.artifact_id">0</td>
              <td tal:content="item.artifact_assignment_id">12345</td>
              <td tal:content="item.created">12345</td>
              <td tal:content="item.user">McLovin</td>
              <td>
                <ul tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                  <li tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                    Promote
                    <ul tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                      <li tal:condition="(not (env == 'dev' and repeat.item.start and offset == 0)) 
                                          and (not (histdeploy.type.name == 'conf' and (env == 'qat' or env == 'prd')))"
                          tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                        <a tal:attributes="href '/promote?deploy_id=%s&artifact_id=%s&to_env=dev&commit=false' %
                                                (item.deploy_id,
                                                 item.artifact_id,
                                                );
                                           title 'Promote to dev: ' + str(item.artifact_id)"
                           tal:content="'to dev'">promote to dev</a>
                      </li>
                      <li tal:condition="not (env == 'qat' and repeat.item.start and offset == 0) 
                                         and (not (histdeploy.type.name == 'conf' and (env == 'dev' or env == 'prd')))"
                          tal:attributes="class 'promote %s' % env if repeat.item.even else 'promote white'">
                        <a tal:attributes="href '/promote?deploy_id=%s&artifact_id=%s&to_env=qat&commit=false' %
                                                (item.deploy_id,
                                                 item.artifact_id,
                                                );
                                           title 'Promote to qat: ' + str(item.artifact_id)"
                           tal:content="'to qat'">promote to qat</a>
{'fraction_non_alphanumeric': 0.1619764233759719, 'fraction_numerical': 0.011236518685728617, 'mean_word_length': 1.9266001174398122, 'pattern_counts': {'":': 0, '<': 391, '<?xml version=': 0, '>': 391, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 58, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3932290', 'n_tokens_mistral': 6194, 'n_tokens_neox': 5779, 'n_words': 1111}