<commit_before><!--<img src="${req.contextPath}/download/resources/alm-octane-logo.png" border="0"/>-->
<script>
    function testConfiguration() {
        var p = document.getElementById("resultPNode");
        p.textContent ='';
        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function () {
            if (this.readyState == 4 && this.status == 200) {
                var p = document.getElementById("resultPNode");
                // clear children
                p.textContent ='';
                var t = document.createTextNode(this.responseText);
                if (this.responseText.toLocaleLowerCase().includes("success")) {
                    p.style.color = "green";
                }
                else {
                    p.style.color = "red";
                }
                p.appendChild(t);
            }
        };
        xhttp.open("POST", "${req.contextPath}/rest/octane/1.0/testconnection", true);
        xhttp.setRequestHeader('content-type','application/json');
        xhttp.send(JSON.stringify({
            octaneUrl: document.getElementById("octaneConfigurationForm_octaneUrl").value,
            accessKey: document.getElementById("octaneConfigurationForm_accessKey").value,
            apiSecret: document.getElementById("octaneConfigurationForm_apiSecret").value,
            userName: document.getElementById("octaneConfigurationForm_userName").value
        }));
    }
</script>
<h1>HPE ALM Octane CI Plugin</h1>
<div class="paddedClearer"></div>
[@ww.form action="/admin/nga/configureOctaneSave.action"
id="octaneConfigurationForm"
submitLabelKey='global.buttons.update']
[@ui.bambooSection title="HPE ALM Octane Server Configuration"]
[@ww.textfield name='octaneUrl' label='Location' required='true' description='Location of the HPE ALM Octane application' /]
[@ww.textfield name="accessKey" label='Client ID'  required='true' description='Client ID used for logging into the ALM Octane server'/]
[@ww.password name="apiSecret" label='Client secret'  showPassword="true" required='true' description='Client secret used for logging into the ALM Octane server'/]
[@ww.textfield name="userName" label='Bamboo user'  required='true' description='The user to impersonate (Jobs will be executed on behalf of this user)'/]
[/@ui.bambooSection]
[/@ww.form]
<script>
    // adding the check connection button
    var buttonsContainer = document.querySelector('#octaneConfigurationForm > .buttons-container > .buttons'),
    testButton = document.createElement('input');
    testButton.type = 'button';
    testButton.value = 'Test Connection';
    testButton.className = 'aui-button aui-button-primary';
    testButton.onclick = testConfiguration;
    buttonsContainer.appendChild(testButton);
    // adding the check result text
    var buttonsContainer = document.querySelector('#octaneConfigurationForm > .buttons-container '),
    pAnswer = document.createElement('p');
    pAnswer.id = "resultPNode";
    buttonsContainer.appendChild(pAnswer);
    var t = document.createTextNode("");
    pAnswer.appendChild(t);
</script><commit_msg>defect #137043 - [Regression Day 17/11] Bamboo user can run job where he is viewer<commit_after><!--<img src="${req.contextPath}/download/resources/alm-octane-logo.png" border="0"/>-->
<script>
    function testConfiguration() {
        var p = document.getElementById("resultPNode");
        p.textContent ='';
        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function () {
            if (this.readyState == 4 && this.status == 200) {
                var p = document.getElementById("resultPNode");
                // clear children
                p.textContent ='';
                var t = document.createTextNode(this.responseText);
                if (this.responseText.toLocaleLowerCase().includes("success")) {
                    p.style.color = "green";
                }
                else {
                    p.style.color = "red";
                }
                p.appendChild(t);
            }
        };
        xhttp.open("POST", "${req.contextPath}/rest/octane/1.0/testconnection", true);
        xhttp.setRequestHeader('content-type','application/json');
        xhttp.send(JSON.stringify({
            octaneUrl: document.getElementById("octaneConfigurationForm_octaneUrl").value,
            accessKey: document.getElementById("octaneConfigurationForm_accessKey").value,
            apiSecret: document.getElementById("octaneConfigurationForm_apiSecret").value,
            userName: document.getElementById("octaneConfigurationForm_userName").value
        }));
    }
</script>
<h1>HPE ALM Octane CI Plugin</h1>
<div class="paddedClearer"></div>
[@ww.form action="/admin/nga/configureOctaneSave.action"
id="octaneConfigurationForm"
submitLabelKey='global.buttons.update']
[@ui.bambooSection title="HPE ALM Octane Server Configuration"]
[@ww.textfield name='octaneUrl' label='Location' required='true' description='Location of the HPE ALM Octane application' /]
[@ww.textfield name="accessKey" label='Client ID'  required='true' description='Client ID used for logging into the ALM Octane server'/]
[@ww.password name="apiSecret" label='Client secret'  showPassword="true" required='true' description='Client secret used for logging into the ALM Octane server'/]
[@ww.textfield name="userName" label='Bamboo user'  required='true' description='The account that will run jobs for ALM Octane (must have build plan permissions).'/]
[/@ui.bambooSection]
[/@ww.form]
<script>
    // adding the check connection button
    var buttonsContainer = document.querySelector('#octaneConfigurationForm > .buttons-container > .buttons'),
    testButton = document.createElement('input');
    testButton.type = 'button';
    testButton.value = 'Test Connection';
    testButton.className = 'aui-button aui-button-primary';
    testButton.onclick = testConfiguration;
    buttonsContainer.appendChild(testButton);
    // adding the check result text
    var buttonsContainer = document.querySelector('#octaneConfigurationForm > .buttons-container '),
    pAnswer = document.createElement('p');
    pAnswer.id = "resultPNode";
    buttonsContainer.appendChild(pAnswer);
    var t = document.createTextNode("");
    pAnswer.appendChild(t);
</script>
{'fraction_non_alphanumeric': 0.13068362480127185, 'fraction_numerical': 0.004451510333863275, 'mean_word_length': 3.3476157567380787, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6204536', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1659, 'n_words': 361}