Skip to content

Instantly share code, notes, and snippets.

@kjivan
kjivan / spring-boot-debugging.md
Created March 2, 2024 06:05
Spring Boot Debugging

Spring Boot Debugging

Enable actuators and values

management.endpoints.web.exposure.include=*
management.endpoint.env.show-values=ALWAYS

Enable SQL Logging

@kjivan
kjivan / feature-implementation-best-practices.md
Created February 15, 2024 22:58
Feature Implementation Best Practices

Feature Implementation Best Practices

Debugging Best Practices

Preparation

  • Establish a clear understanding of the issue
    • Ask issue reporter/lead about issue if needed
  • Reproduce the issue
    • Is it a workflow that is causing the issue
    • Is it particular data that is causing the issue
    • Is it a combination of the above
  • Is there a timing issue or a race condition issue
@kjivan
kjivan / error-handling-best-practices.md
Last active February 7, 2024 17:17
Error Handling Best Practices

Error Handling Best Practices

  • System Errors
    • eg null pointers/failed db query/failed api calls
    • Log this at the error level
    • Log stack trace if possible
    • Log any relevant identifiers if possible
    • Don't log any unapproved sensitive data
  • User errors
  • eg invalid zip code/name length
@kjivan
kjivan / logging-best-practices.md
Last active March 8, 2024 15:33
Logging Best Practices

Logging Best Practices

This assumes you have a fast memory logging system.

Use 4 logging levels

  • error - Log critical system errors only (not user errors)
  • warn - Log things that are potential errors or can become errors
  • info(default) - Logs info about events in the system
  • debug - Log more detailed info about debugging
@kjivan
kjivan / github-json.yaml
Created January 24, 2024 15:25
Github JSON
name: Pipeline
on:
push:
jobs:
log-json:
name: Run test command & log github json
runs-on:
- self-hosted
steps:
@kjivan
kjivan / lombok-best-practices.md
Last active February 14, 2024 00:37
Lombok Best Practices

Flaky Test Loop

for i in {1..10}; do
   ./gradlew integrationTest || {echo "Failed after $i attempts" && break}
done
@kjivan
kjivan / github-actions.md
Last active July 14, 2023 20:38
Github Actions

Github Actions

Running github actions repeatedly

gc -m "Whatever" -a; \
gp; \
gh pr create --fill; \
gh pr merge -m
apply plugin: 'com.diffplug.spotless'
spotless {
java {
removeUnusedImports()
prettier(['prettier': 'latest', 'prettier-plugin-java': 'latest']).config(['parser': 'java', 'useTabs': true])
}
groovyGradle {
greclipse()
}
}