Mastering dci-check-change
Back to all posts

Introduction

In this blog post, we have already reviewed dci-check-change utility to properly test changes submitted to the DCI agents, allowing its testing and validation prior to merge the changes in the master branch.

With that information, you should be already aware of the following:

This blog post will cover advanced use cases where dci-check-change can be used to test complex scenarios like the following:

Using prefixes with dci-check-change

In this blog post, we have already covered the basics about using prefixes with dci-check-change, to target specifics hosts/settings when running dci-openshift-agent or dci-openshift-app-agent.

Remember to do the following when trying to use dci-check-change with the support of prefixes (which is also documented in DCI Development docs):

When we say <change>, remember we can only provide the URL to a specific change to dci-check-change, but we can test multiple changes at the same time by including Depends-On: or Build-Depends: dependencies to the change you are providing to dci-check-change, as stated here.

Using complex hints

You already know that hints allow tunning the execution of the debug job that is run by dci-check-change. However, note that there are different types of hints that allow you to apply different configurations. Here we will provide some tips for each hint currently available, together with some examples of Gerrit changes making use of them, which can be classified in two different ways:

Also, do not forget to set up correctly the SUPPORTED_HINTS variable in your /etc/dci-openshift-agent/config file to activate/deactivate the hints that can be allowed in your lab. Depending on its value, this would imply that you can/cannot use some of the hints aforementioned.

By the way, if there's any debug job you want to run, where you have some hints configured in your change, and for that particular job you don't really want to use these hints, so that you only want to run the default scenario, then you can use -f argument like dci-check-change -f <change> to disobey hints.

Provide extra variables without using prefixes or hints

If you don't want to rely on prefixes or hints to provide some specific variables to some jobs, you can directly pass extra variables to dci-check-change by appending -e "<variable name>"="<value>" for some simple cases. However, its usage is limited to really simple variables, so we recommend the usage of prefixes or hints for more complex cases.

Vote? Or not vote?

If you follow the steps to set up a continuous integration system to validate changes, don't forget to set up the DO_VOTE variable in your /etc/dci-openshift-agent/config file, so that dci-check-change will vote when running the jobs, else it will not.

Also, you have -n argument in dci-check-change (e.g. dci-check-change -n <change>) to force the utility not to vote or comment on changes.

Avoid dci-queue usage

This tip is a simple one. dci-queue is a great utility to properly manage a lab composed by different resources that can be used for testing. If you want to avoid dci-queue when using dci-check-change, you need to set up NO_DCI_QUEUE as an environment variable (always when dci-queue is available).

Conclusion

To sum up, we have seen several examples of the power and flexibility that dci-check-change can bring us to test different, complex scenarios. Moreover, here we leave some recommendations related to the topics we have covered in this blog post:

We hope this blog post is useful for you to continue using dci-check-change when dealing with troubleshooting with some of the DCI agent changes. Do not hesitate to reach Telco CI team for whatever question you may have on this topic or to extend any topic covered here!