Git Lab Merge and Pull Request Templates – An Experiment

Git Lab Merge Request Templates are a fairly exciting way for me to help drive consistency in the projects I am participating in – internal, external and personal.   I created a new folder in .gitlab/issue_templates/and added a file Merge_Request.md ( based on Pull Request).  For GitHub (not GitLab) switch the folder to .github.

When you go to raise a Merge Request, you can select a template using the template query parameter on GitHub https://github.com/prb112/examples/compare/readme-update?expand=1&template=Merge_Request.md

You can see the example at Pull Request 4.  Developers can select the check boxes and indicate if they are compliant with the minimum to commit.

Merge and Pull Request Template
Merge and Pull Request Template

GitLab is slightly different, and that you select the template from a drop down.  I actually prefer this approach which makes it easier to select.

Good luck, go forth and be consistent with Pull Requests and Merge Requests.

 

Primer: Tips for using Random Test Files

On Mac and Linux, create a random file (https://stackoverflow.com/questions/257844/quickly-create-a-large-file-on-a-linux-system)
dd if=/dev/urandom of=random-test-file-100m bs=1024k count=100

Example:
$ dd if=/dev/urandom of=random-test-file-100m bs=1024k count=100
100+0 records in
100+0 records out
102400000 bytes transferred in 10.143507 secs (10095128 bytes/sec)

This is a random file. You should also use shasum -A 256 and make sure the file you are using for test is what you get back. Do also remember 1024 bytes to a KB… use blocksizes of 1024

On linux, create a fast file (https://stackoverflow.com/a/11779492):
fallocate -l 100M test-file-100m

This takes less than a second. The file is not good for testing random behaviors with large files as the generated file is huge, but the same bytes repated for 100M.

To check the size of the sample files, you can use human readable format settings (https://unix.stackexchange.com/a/281113).

MacBook-Air:test user$ ls -lSh
total 24
-rw-r–r– 1 user staff 10K Dec 20 19:53 setup.log

Deleting a bad changelog in Liquibase

1 – Identify the change set you need to remove (to run again)

<changeSet author=“me” id=“2.1.0-x-table”>
<sqlFile path=“/mycustomsql.sql”
relativeToChangelogFile=false” stripComments=“true” />
</changeSet>

2 – As your db instance owner, remove the change log entry
[db2inst1@db myfolder]$ db2 “DELETE from myschema.DATABASECHANGELOG WHERE ID = ‘2.1.0-x-table'”
DB20000I The SQL command completed successfully.

3 – Confirm the change log is removed
[db2inst1@db myfolder]$ db2 “select * from myschema.DATABASECHANGELOG WHERE ID = ‘2.1.0-x-table’”

Quick Method to see Kafka-Broker uptime

Quick Method to see Kafka-Broker uptime

lstart and etime are the actual start time and the actual elapsed time since start

[userid@kafka-server ~]$ ps -eo pid,comm,lstart,etime,time,args | grep -i kafka | grep -v grep
9863 java Thu Nov 3 16:19:38 2017 05:25:55 00:09:55 /usr/jdk64/java-1.8.0-openjdk-1.8.0.77-0.b03.el7_2.x86_64/bin/java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=true -Xloggc:/var/log/kafka/kafkaServer-gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Dkafka.logs.dir=/var/log/kafka -Dlog4j.configuration=file:/usr/iop/current/kafka-broker/bin/../config/log4j.properties -cp :/kafka-broker/bin/../libs/* -Xmx8g -Xms8g -Djava.security.auth.login.config=/kafka-broker/config/kafka_jaas.conf kafka Kafka /kafka-broker/config/server.properties