Scripts
Set up AI stuff
Feature.enable(:ai_related_settings)
Feature.enable(:openai_experimentation)
puts "enter open_ai api key"
openai_api_key = gets
openai_api_key = openai_api_key.chomp
Gitlab::CurrentSettings.update(openai_api_key: openai_api_key)
Gitlab::CurrentSettings.update(check_namespace_plan: true)
# make gitlab-org Ultimate
group = Group.find_by_path('gitlab-org')
plan_id = Plan.find_by(name: 'ultimate').id
group.update_attribute(:gitlab_subscription_attributes, { hosted_plan_id: plan_id })
# enable features for group
group.update_attribute(:experiment_features_enabled, true)
group.update_attribute(:third_party_ai_features_enabled, true)
# make gitlab-test project public
project = Project.find_by_full_path('gitlab-org/gitlab-test')
project.update_attribute(:visibility, 'public')
# enable plan features
Feature.enable(:summarize_comments)
Feature.enable(:generate_description_ai)
# other keys and things
Feature.enable(:tofa_experimentation_main_flag)
Feature.enable(:anthropic_experimentation)
Feature.enable(:tanuki_bot)
Inline image diff failures in rspec feature tests
Run in devtools console on Job page of a failed capybara tests
(() => {
let fails = [
...document.querySelectorAll('.term-fg-red'),
...document.querySelectorAll('.term-fg-yellow')
]
let projectPath = location.pathname.split('-/jobs')[0]
fails.forEach((fail) => {
let text = fail.innerText
if (text.endsWith('.png')) {
let filePath = text
.replace(`/builds${projectPath}`, '') // gitlab-ui
.replace('Image screenshot: ', '') // gitlab-ce
let type = 'raw' // 'file' for <a> tag
let testsPath = `artifacts/${type}`
fail.innerHTML = `
<img src="${location.href}/${testsPath}/${filePath}"
class="mw-100"
>`
// <a href="${location.href}/${testsPath}/${filePath}"
// class="term-fg-l-red"
// target="_blank"
// >${text}</a>`
}
})
})()
ez-squash
rebase without rebase
#!/env/bash
set -e
BRANCH2SQASH=git branch --show-current
git merge master
git checkout -b psi-temp
git branch -D $BRANCH2SQASH
git checkout master
git checkout -b $BRANCH2SQASH
git merge --squash psi-temp
git checkout -D psi-temp
Personal projects
View allInfo
Frontend Engineer / Stylesheet Computer at Plan, GitLab
Melbourne, Australia
7:06 PM
Member since November 08, 2016