aqa-test-tools
                                
                                 aqa-test-tools copied to clipboard
                                
                                    aqa-test-tools copied to clipboard
                            
                            
                            
                        TRS Server can't use Jenkins Password that has Special Characters
Relevant Code Snippet
https://github.com/AdoptOpenJDK/openjdk-test-tools/blob/414ec78d4edadf6542ba2a53357e73037494ba21/TestResultSummaryService/JenkinsInfo.js#L64-L77
JenkinsInfo.js can't use the password that has special characters such as "!" to communicate with Jenkins properly, giving 401 Unauthorized error.
Helpful Links
https://github.com/jansepar/node-jenkins-api We tried replacing the original code with this snippet but didn't have much luck:
// Password that needs to be %-encoded
const { URL } = require('url');
const jenkinsUrl = new URL('https://[email protected]');
jenkinsUrl.password = 'some_weirdPASSWORD123!@#$%^&*()~`\\/;\'';
var jenkins = jenkinsapi.init(jenkinsUrl.href);
Workaround
- Can use a password that doesn't have special characters.
- Can use a token instead of password: https://stackoverflow.com/questions/45466090/how-to-get-the-api-token-for-jenkins.