Jesse Glick commented on Improvement JENKINS-18289

A script like the following can be useful for diagnosis:

CANONICAL_ID_FORMATTER = new java.text.SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
NUMBER_XPATH = "/node()/number";
xpath = javax.xml.xpath.XPathFactory.newInstance().newXPath();
for (j in Jenkins.instance.getAllItems(AbstractProject)) {
  d = new File(j.rootDir, 'builds');
  m = new TreeMap();
  for (b in d.listFiles()) {
    xml = new File(b, 'build.xml');
    if (!xml.file) {
      if (!b.getName().startsWith('last')) {
        println("not a build dir: ${b}");
      }
      continue;
    }
    try {
      CANONICAL_ID_FORMATTER.parse(b.name);
      xpath.reset();
      number = xpath.evaluate(NUMBER_XPATH, new org.xml.sax.InputSource(new java.io.FileReader(xml)), javax.xml.xpath.XPathConstants.NODE);
      if (number) {
        m.put(b.name, number.textContent);
      } else {
        println("cannot parse ${xml}");
      }
    } catch (java.text.ParseException e) {
      if (!Util.isSymlink(b)) {
        println("${b} should be a symlink but is not");
      }
    }
  }
  original = m.values().collect({Integer.parseInt(it)});
  if (!original.equals(original.sort(false))) {
    println("out of order in ${d}: ${m}");
  }
}
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to