Comment 1 for bug 1306793

Revision history for this message
Daniel Manrique (roadmr) wrote :

requirements allows you to insert arbitrary links (name and URL) in the xml report. It was placed in miscellanea/submission-resources to avoid maintaining resources "the old way", with the downside that, as you observed, if the files it depends on are not present, it will barf and cause inconsistent results. This is mostly cosmetic because all the other dependencies of submission-resources will run; and that's the whole point, other than that, we don't really care about submission-resources itself.

For correctness and to avoid confusion, requirements resource should NOT exit with failure if the file it tries to read doesn't exist.

The command for the requirements job is:

command: [ -f $PLAINBOX_SESSION_SHARE/requirements_docs.txt ] && cat $PLAINBOX_SESSION_SHARE/requirements_docs.txt

This can change to:

command: if [ -f $PLAINBOX_SESSION_SHARE/requirements_docs.txt ]; then cat $PLAINBOX_SESSION_SHARE/requirements_docs.txt; else true; fi

Using if/then/else/fi is needed because just adding ||true at the end of the original command will not fail if the file *exists* but is unreadable (if cat blahblah returns error).