Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make coverity-scan.sh usable by hand #6747

Merged
merged 4 commits into from
Aug 31, 2019
Merged

Conversation

ktsaou
Copy link
Member

@ktsaou ktsaou commented Aug 30, 2019

./coverity-scan.sh should be easily usable by hand.

Prior to this PR, developers should remember to export certain variables (REPOSITORY and COVERITY_SCAN_SUBMIT_MAIL). They were given to option to configure COVERITY_SCAN_TOKEN and configure the path of the cov-build by configuring separate files for each of them. So, a developer was not able to just configure its environment and then just run the script every time it is needed.

This PR allows devs to create the file .coverity-scan.conf with the following information:

# the repository to report to coverity - devs can set here their own fork
REPOSITORY="netdata/netdata"

# the email of the developer, as given to coverity
COVERITY_SCAN_SUBMIT_MAIL="[email protected]"

# the token given by coverity to the developer
COVERITY_SCAN_TOKEN="TOKEN taken from Coverity site"

# the absolute path of the cov-build - optional
COVERITY_BUILD_PATH="/opt/cov-analysis-linux64-2019.03/bin/cov-build"

# when set, the script will print on screen the curl command that submits the build to coverity
# this includes the token, so the default is not to print it.
COVERITY_SUBMIT_DEBUG=1

The script is also updated to configure netdata with the following:


	--enable-https \
	--enable-jsonc \
	--enable-plugin-nfacct \
	--enable-plugin-freeipmi \
	--enable-plugin-cups \
	--enable-backend-prometheus-remote-write \

Ideally, the script should build all the features of netdata, including:


	--enable-plugin-xenstat \
	--enable-backend-kinesis \
	--enable-backend-mongodb \

@paulkatsoulakis I don't know if we should enable these on travis.

Also:

  • coverity-install.sh is not needed any more. Run ./coverity-scan.sh --with-install to install coverity build tools. @paulkatsoulakis please update travis and then simply remove coverity-install.sh from the repo (the update version of this script just calls ./coverity-scan.sh install.
  • the installation will fail if the downloaded version is not the expected one
  • the scan will fail if the expected version of coverity is not installed
  • the installer functions.sh is used to simplify the script and beautify the output

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2019

CLA assistant check
All committers have signed the CLA.

return 0
}

if [ "${1}" = "install" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to use a --with-install option instead that will just run the install together with the run?

@paulkatsoulakis
Copy link
Contributor

--enable-plugin-xenstat
--enable-backend-kinesis
--enable-backend-mongodb \

Yep, i need to add a few different combinations of configure options to be tested rather than a single one that we have now. I 'll get to it as soon as we merge this

if [ -f ".coverity-scan.conf" ]
then
source ".coverity-scan.conf" || exit 1
fi
Copy link
Contributor

@paulkatsoulakis paulkatsoulakis Aug 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably write it as: [ -f ".coverity-scan.conf" ] && source ".coverity-scan.conf", but that may be just matter of personal preference.

Also instead of the exit 1 logic, is better to just set set -e to enable strict error checking and just use the || option for commands we don't want them to stop the process if they fail. what do you think?

@paulkatsoulakis
Copy link
Contributor

BTW we can just merge this and let me take over the rest of the work, but from the commit flow i understand you still working on it

@paulkatsoulakis paulkatsoulakis merged commit fd9eb73 into netdata:master Aug 31, 2019
@paulkatsoulakis
Copy link
Contributor

Taking over as agreed, will come with follow up PR to wrap this up

jackyhuang85 pushed a commit to jackyhuang85/netdata that referenced this pull request Jan 1, 2020
* make coverity-scan.sh usable by hand

* updated debug variable and docs

* merge coverity-scan.sh and coverity-install.sh

-- MERGING AND TAKING OVER FURTHER IMPROVEMENTS as agreed --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants