test-day-279

Today’s Task

  • SlackBot Recut Flow
  • deploy stg job less timeout
  • skip wip pods on AWS
  • message channel to public
  • catlaog liquibase image trigger
  • keymaster liquibase conf path support
  • fix ‘null’ prefix in build description

Additional Task

Thought

1

Keymaster Liquibase Job 花了很久 debug

keymaster image -> docker image for liquibase k8s job -> run on k8s pods

entrypoint.sh 里面的改动需要重做 keymaster image 之后才会对 liquibase job image 生效

liquibase job image 用 km image 的 binary version 作为 tag

改完 script 之后再 build 的时候 tag 也是同一个。。。

相当于 image 里面的东西没有变

2

总感觉时间不够用

FY23Q4-slackbot-improvements

Todo List

  • Convert JS to TS
  • Call Jenkins
  • Recut Flow
  • Save request to local db
  • Show recent request info

Call Jenkins

  • Test Job w/o params
  • Test Job w/ params
  • Find APIs
  • Axios Post with FormData

Recut Flow

  • Component to Repo Map for Code-Merge

  • Component to ReleaseJob Map

  • ReleaseJob Parameters ?

  • Different Bulid Status Error Handling

  • Default Initial Values

FY23Q4-hadar-improvements

Hadar TODO List

  • Hadar Auto Start on CM Day
  • Save groovy script exceptions to local files
  • Fetch Jenkins Job log
  • Nav Bar Simplify
  • Fastrun Regression
  • Hadar Serialization (Restore status and progress after service restart)
  • Dark Mode
  • Save Slackbot token to Configuration file

FY23Q4-script-improvements

Todo List

STG Deployment

  • Add retry when failed
  • less timeout (1000s -> 750s)
  • Skip WIP pods on AWS (billing, qahandler)
  • Split message when deploy failure
  • Fix Retry (gen parameters from failed pod log)
  • Change message channel to public

Audit

  • Fix Preference Center
  • Filter out Billing_tools
  • Filter Out CICD Components
  • Fix Message parametes

Audit T3

  • Detect commits into release branch
  • Message Channel to Pulic
  • Add Lockbox Legacy

Image Scripts

  • Catalog liquibase image auto trigger
  • Saola Trigger All parameters
  • Lockbox sloth, vaquita, cp common base image
  • Parameter Check to avoid image from retro branch merged to release (retro/xxx_MERGED)

Liquibase job

  • Keymaster new config path support
  • Fix ‘null’ prefix in description
  • Message for Liquibase Image
  • Message for Liquibase with Vault Support

Code Merge

  • Block Merge-cut and recut for retro branch

Data-Consistency Tool

  • Fix Message when jenkins git plugin error

test-day-278

Today’s Task

  • slack bot call jenkins

  • T3 audit fix

  • Change hosts on gitlab runner to support mysql

  • Fix Hosts for DB repo pipeline

  • Update Lockbox baseimage

  • Fix Check Artifactory Token Expiration Message

Additional Task

  • CM Support

Thought

shared lib db 跑 ut test 的正确打开方式是?

按照 readme 里的命令什么 test 都没跑

有一台 eadp mysql 的 hosts 需要改

改完之后好像还有台 oracle 连不上

slackbot-dev-notes

Convert JS to TS

1
2
npm install typescript ts-node
npx tsc --init

然后会有一份 tsconfig.json

大致是改了下面这些配置

把原本的源码扔进 ./src 里面

然后挨个调整下 function return type 和 parameter type

以及 import 和 export

1
2
3
4
5
6
7
8
9
10
11
12
13
14
"target": "es2016",
"module": "commonjs",
"rootDir": "src",
"moduleResolustion": "node",
"resolveJsonModule": true,
"allowJs": true,
"checkJs": true,
"sourceMap": true,
"outDir": "dist",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true

config files

原本一大堆 token 是写在 json file 里的

dotenv 也许可以更优雅

1
2
3
4
5
import { resolve } from 'path';
import { config } from 'dotenv';

const pathToConfig = '../../.env';
config({ path: resolve(__dirname, pathToConfig) });
1
2
3
import './utils/env';

const foo = process.env.BAR;

Docker

1

Q: image 1GB+

A: 用 node:18-alpine

2

如果是前端项目,也许可以 build static files 然后用 nginx host

Call Jenkins with paramerters

parameters form data

data: Map<String, String> or FormData, Object.fromEntries(parameters)

headers: { Content-Type: multipart/form-data }

jenkins https support

1
httpsAgent: new https.Agente({rejectUnauthorized: false})

queue item 404 when postman testing

jenkins queue item id 只会保留半分钟左右,

queue item id -> build id -> build url

1
2
3
4
import crypto from 'crypto';
httpsAgent: new httpsAgent({
secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT
})

FormData

FormData 从 node 16 以后开始支持,早了认不出

test-day-275

Today’s Task

  • Slackbot Image
  • Slackbot JS -> TS

Additional Task

  • Deploy Nucleus Batchframework for Min
  • Deploy Qahandler & billing for Matt

Thought

Blog -> dev notes

WE2023 -> TODO list

OneNote -> Emotional Damage for Real

一边做类型体操一边悔恨为啥不当初一开始就用 ts 写

test-day-274

Today’s Task

  • Hadar Auto Start
  • Slack Bot recut flow

Additional Task

  • Help on PRD version page

Thought

0

短短一周

捡的 T420 主板短路彻底点不亮了 = =

原本是打算加块 msata 2242 然后带两块 hdd 当廉价家用服务器共享文件的

干脆还是不要再浪费钱和时间在这台 Frankenstein 上了…

我需要把精力专注在软件的开发而不是硬件的维修上

test-day-272

Today’s Task

  • Saola trigger all image build

Additional Task

  • Help Matt on deploying billing and qahandler
  • Review PRD wiki page

Thought

小黑屋里的机器有些能够 call 通 iad2 Jenkins 的特定 REST API

slack bot 需要改成 ts 吗?