---
# System prepended metadata

title: Pre-commit work
tags: [Design]

---


# Pre-commit work

###### tags: `Design`

## Testing pre-commit with ci root container
Dockerfile:
```
FROM registry.ci.openshift.org/openstack-k8s-operators/tools:ci-build-root-golang-1.19-sdk-1.26
RUN pip3 install pre-commit
```
Building:
```
podman build -f Dockerfile -t openstack-operator-ci-pre-commit
```
Running pre-commit:
```
podman run -it --mount type=bind,src=${PATH_TO_OPERATOR},dst=/alabama/${OPERATOR},relabel=shared localhost/openstack-operator-ci-pre-commit:latest /bin/bash

cd /alabama/${OPERATOR}

export SKIP=no-commit-to-branch
export PRE_COMMIT_HOME=/tmp
export GOCACHE=/tmp
export GOLANGCI_LINT_CACHE=/tmp/.cache
export GOPROXY=https://proxy.golang.org
export GOLANGCI_LINT_CACHE=/tmp
export GOFLAGS=

pre-commit run -a --show-diff-on-failure
```

## Pre-commit PRs
-  ~~https://github.com/openstack-k8s-operators/octavia-operator/pull/103~~ : 
- ~~https://github.com/openstack-k8s-operators/cinder-operator/pull/147 :~~ 
- ~~https://github.com/openstack-k8s-operators/openstack-operator/pull/204 : Pre-commit job fails on golangic-lint download timeout~~ 
- ~~https://github.com/openstack-k8s-operators/nova-operator/pull/269 : Waiting for job to pass~~
- ~~https://github.com/openstack-k8s-operators/mariadb-operator/pull/79~~: 
- ~~https://github.com/openstack-k8s-operators/designate-operator/pull/20 : Needed core review~~


## Prow pre-commit jobs openshift/release
- ~~https://github.com/openshift/release/pull/36752 : Pre-commit job for otavia operator~~ 
- ~~https://github.com/openshift/release/pull/36751 : Pre-commit job for ovn-operator~~
- ~~https://github.com/openshift/release/pull/36396 : Onboard install yamls repo~~
- ~~https://github.com/openshift/release/pull/36013 : Pre-commit job for ovs operator~~
- ~~https://github.com/openshift/release/pull/36012 : Pre-commit job for neutron operato~~r
    - ~~https://github.com/openshift/release/pull/38080~~ - ~~gibi is working on another PR~~
- ~~https://github.com/openshift/release/pull/36011 : Pre-commit job for mariadb operator~~
- ~~https://github.com/openshift/release/pull/36010 : pre-commit job for glance operator~~
- ~~https://github.com/openshift/release/pull/36003 : pre-commit job for ironic operator~~
- ~~https://github.com/openshift/release/pull/35864 : pre-commit job for cinder operator~~


## Add revive and ginkgolinter to golanci

* ~~https://github.com/openstack-k8s-operators/glance-operator/pull/196~~
* ~~https://github.com/openstack-k8s-operators/keystone-operator/pull/225~~
* ~~https://github.com/openstack-k8s-operators/dataplane-operator/pull/147~~
* ~~https://github.com/openstack-k8s-operators/ovs-operator/pull/91~~
* ~~https://github.com/openstack-k8s-operators/openstack-operator/pull/264~~
* ~~https://github.com/openstack-k8s-operators/openstack-ansibleee-operator/pull/139~~
* ~~https://github.com/openstack-k8s-operators/octavia-operator/pull/113~~
* ~~https://github.com/openstack-k8s-operators/ironic-operator/pull/196~~
* ~~https://github.com/openstack-k8s-operators/ovn-operator/pull/38~~
* ~~https://github.com/openstack-k8s-operators/openstack-baremetal-operator/pull/6~~
* ~~https://github.com/openstack-k8s-operators/neutron-operator/pull/135~~
* ~~https://github.com/openstack-k8s-operators/heat-operator/pull/58~~
* ~~https://github.com/openstack-k8s-operators/designate-operator/pull/37~~
* ~~https://github.com/openstack-k8s-operators/mariadb-operator/pull/90~~
* ~~https://github.com/openstack-k8s-operators/infra-operator/pull/28~~


## Remove duplicate code

* ~~https://github.com/openshift/release/pull/38448~~ - glance
* ~~https://github.com/openshift/release/pull/38453~~  - mariadb
* ~~https://github.com/openshift/release/pull/38499~~ - ironic
* ~~https://github.com/openshift/release/pull/38505~~ - keystone
* ~~https://github.com/openshift/release/pull/38526~~ - dataplane
* ~~https://github.com/openshift/release/pull/38527~~ - openstack
* ~~https://github.com/openshift/release/pull/38528~~ - openstack-ansiblee
* ~~https://github.com/openshift/release/pull/38529~~ - octavia
* ~~https://github.com/openshift/release/pull/38531~~ - neutron
* ~~https://github.com/openshift/release/pull/38532~~ - ovs
* ~~https://github.com/openshift/release/pull/38533 - ovn~~
* ~~https://github.com/openshift/release/pull/38534~~ - infra



## Add ginkgolint

* ~~https://github.com/openstack-k8s-operators/glance-operator/pull/204~~
* ~~https://github.com/openstack-k8s-operators/cinder-operator/pull/194~~
* ~~https://github.com/openstack-k8s-operators/mariadb-operator/pull/99~~
* ~~https://github.com/openstack-k8s-operators/ironic-operator/pull/219~~
* ~~https://github.com/openstack-k8s-operators/keystone-operator/pull/233~~
* ~~https://github.com/openstack-k8s-operators/designate-operator/pull/40~~
* ~~https://github.com/openstack-k8s-operators/dataplane-operator/pull/157~~
* ~~https://github.com/openstack-k8s-operators/openstack-operator/pull/277~~
* ~~https://github.com/openstack-k8s-operators/openstack-ansibleee-operator/pull/143~~
* ~~https://github.com/openstack-k8s-operators/octavia-operator/pull/128~~
* ~~https://github.com/openstack-k8s-operators/openstack-baremetal-operator/pull/7~~
* ~~https://github.com/openstack-k8s-operators/heat-operator/pull/77~~
* ~~https://github.com/openstack-k8s-operators/neutron-operator/pull/139~~
* ~~https://github.com/openstack-k8s-operators/ovs-operator/pull/107~~
* ~~https://github.com/openstack-k8s-operators/ovn-operator/pull/42~~
* ~~https://github.com/openstack-k8s-operators/manila-operator/pull/53~~
* ~~https://github.com/openstack-k8s-operators/infra-operator/pull/28~~
* ~~https://github.com/openstack-k8s-operators/horizon-operator/pull/101~~