commit a9a7e13bbebb6bee9aa59d8fcc3580238256b98e Author: uhryniuk Date: Thu Jan 15 20:18:23 2026 -0600 init: technical take home for gitlab operate diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..28f57c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +# test binary +*.test + +# vendored dependencies +vendor/ + +# workspace +go.work +go.work.sum + +# build output +interview-server +build/ \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..8729686 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,83 @@ +stages: + - test + - build + - validate + +variables: + DOCKER_IMAGE: docker.io/uhryniuk/go-server + DOCKER_TAG: $CI_COMMIT_SHORT_SHA + +# Go build job +go:build: + stage: test + image: golang:1.23-alpine + cache: + key: go-mod + paths: + - .go/pkg/mod/ + variables: + GOPATH: $CI_PROJECT_DIR/.go + script: + - go build -o interview-server . + artifacts: + paths: + - interview-server + expire_in: 1 hour + +# Go unit tests +go:test: + stage: test + image: golang:1.23-alpine + cache: + key: go-mod + paths: + - .go/pkg/mod/ + variables: + GOPATH: $CI_PROJECT_DIR/.go + script: + - go test -v -cover + +# Docker build and push +docker:build: + stage: build + image: docker:24 + services: + - docker:24-dind + before_script: + - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker.io + script: + - docker build -t $DOCKER_IMAGE:$DOCKER_TAG -t $DOCKER_IMAGE:latest . + - docker push $DOCKER_IMAGE:$DOCKER_TAG + - docker push $DOCKER_IMAGE:latest + only: + - main + - tags + +# Helm lint +helm:lint: + stage: validate + image: + name: alpine/helm:4.0 + entrypoint: [""] + script: + - helm lint ./helm + +# Helm template validation +helm:template: + stage: validate + image: + name: alpine/helm:4.0 + entrypoint: [""] + script: + - helm version + - helm template test-release ./helm --debug > helm-output.yaml 2>&1 || (cat helm-output.yaml && exit 1) + - | + if [ ! -s helm-output.yaml ]; then + echo "Error: Helm template output is empty" + exit 1 + fi + - echo "Helm template validation successful" + artifacts: + paths: + - helm-output.yaml + expire_in: 1 day diff --git a/.old.git/COMMIT_EDITMSG b/.old.git/COMMIT_EDITMSG new file mode 100644 index 0000000..91f117c --- /dev/null +++ b/.old.git/COMMIT_EDITMSG @@ -0,0 +1,20 @@ +feat(ci): add gitlab CI for build, test and validation + +The CI now has jobs for build and testing the Go service, building and +pushing the docker image along with linting and validating the helm chart. + +Closes #5 + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# interactive rebase in progress; onto 4e45344 +# Last command done (1 command done): +# pick 2a23fb1 feat(ci): add gitlab CI for build, test and validation +# Next command to do (1 remaining command): +# pick 1a67ef1 feat(README): Update README to reflect recent commits +# You are currently rebasing branch '4-document-go-application' on '4e45344'. +# +# Changes to be committed: +# modified: .gitlab-ci.yml +# diff --git a/.old.git/FETCH_HEAD b/.old.git/FETCH_HEAD new file mode 100644 index 0000000..4d17794 --- /dev/null +++ b/.old.git/FETCH_HEAD @@ -0,0 +1,9 @@ +b6a801720d7653823d15c1d53e5dd2d96613030d branch '4-document-go-application' of gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002 +be723bf91dbc13af52d7f73b5f15467cef0c7f1b not-for-merge branch '0001/add-go-webserver' of gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002 +2994726718040e9b7d1f95b5957ada28d5b03b8e not-for-merge branch '2-create-a-simple-go-webserver' of gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002 +832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 not-for-merge branch '3-containerize-service' of gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002 +fa5b934ed6c6536c8f63dd2463d77a9c15218d9c not-for-merge branch '3-create-docker-image' of gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002 +4e45344d9401565cf82acb82932ccb11635a2b48 not-for-merge branch '5-implement-ci-pipeline' of gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002 +1f83c1106dcd22a7e34bd38e57933d06b87c7968 not-for-merge branch '6-create-a-helm-chart-for-deployment' of gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002 +4077c05cfb9fe153e27aedacdb61a7761fa12920 not-for-merge branch 'fix/ci' of gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002 +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 not-for-merge branch 'main' of gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002 diff --git a/.old.git/HEAD b/.old.git/HEAD new file mode 100644 index 0000000..9460edf --- /dev/null +++ b/.old.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/4-document-go-application diff --git a/.old.git/ORIG_HEAD b/.old.git/ORIG_HEAD new file mode 100644 index 0000000..b3ebf4d --- /dev/null +++ b/.old.git/ORIG_HEAD @@ -0,0 +1 @@ +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd diff --git a/.old.git/config b/.old.git/config new file mode 100644 index 0000000..e423532 --- /dev/null +++ b/.old.git/config @@ -0,0 +1,46 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true +[remote "gitlab"] + url = git@gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002.git + fetch = +refs/heads/*:refs/remotes/gitlab/* +[branch "main"] + remote = gitlab + merge = refs/heads/main + vscode-merge-base = origin/main +[branch "0001/add-go-webserver"] + vscode-merge-base = origin/main + remote = gitlab + merge = refs/heads/0001/add-go-webserver +[branch "2-create-a-simple-go-webserver"] + remote = gitlab + merge = refs/heads/2-create-a-simple-go-webserver + vscode-merge-base = origin/2-create-a-simple-go-webserver +[branch "3-containerize-service"] + vscode-merge-base = origin/2-create-a-simple-go-webserver + remote = gitlab + merge = refs/heads/3-containerize-service +[branch "3-create-docker-image"] + vscode-merge-base = origin/2-create-a-simple-go-webserver + remote = gitlab + merge = refs/heads/3-create-docker-image +[branch "6-create-a-helm-chart-for-deployment"] + vscode-merge-base = origin/3-create-docker-image + remote = gitlab + merge = refs/heads/6-create-a-helm-chart-for-deployment +[branch "5-implement-ci-pipeline"] + vscode-merge-base = origin/6-create-a-helm-chart-for-deployment + remote = gitlab + merge = refs/heads/5-implement-ci-pipeline +[branch "4-document-go-application"] + vscode-merge-base = origin/5-implement-ci-pipeline + remote = gitlab + merge = refs/heads/4-document-go-application +[branch "fix/ci"] + remote = gitlab + merge = refs/heads/fix/ci +[remote "gitea"] + url = git@gitea.greatape.dev:username/your-repo-name.git + fetch = +refs/heads/*:refs/remotes/gitea/* diff --git a/.old.git/description b/.old.git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/.old.git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/.old.git/hooks/applypatch-msg.sample b/.old.git/hooks/applypatch-msg.sample new file mode 100755 index 0000000..a5d7b84 --- /dev/null +++ b/.old.git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/.old.git/hooks/commit-msg.sample b/.old.git/hooks/commit-msg.sample new file mode 100755 index 0000000..b58d118 --- /dev/null +++ b/.old.git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/.old.git/hooks/fsmonitor-watchman.sample b/.old.git/hooks/fsmonitor-watchman.sample new file mode 100755 index 0000000..14ed0aa --- /dev/null +++ b/.old.git/hooks/fsmonitor-watchman.sample @@ -0,0 +1,173 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 2) and last update token +# formatted as a string and outputs to stdout a new update token and +# all files that have been modified since the update token. Paths must +# be relative to the root of the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $last_update_token) = @ARGV; + +# Uncomment for debugging +# print STDERR "$0 $version $last_update_token\n"; + +# Check the hook interface version +if ($version ne 2) { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree = get_working_dir(); + +my $retry = 1; + +my $json_pkg; +eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; +} or do { + require JSON::PP; + $json_pkg = "JSON::PP"; +}; + +launch_watchman(); + +sub launch_watchman { + my $o = watchman_query(); + if (is_work_tree_watched($o)) { + output_result($o->{clock}, @{$o->{files}}); + } +} + +sub output_result { + my ($clockid, @files) = @_; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # binmode $fh, ":utf8"; + # print $fh "$clockid\n@files\n"; + # close $fh; + + binmode STDOUT, ":utf8"; + print $clockid; + print "\0"; + local $, = "\0"; + print @files; +} + +sub watchman_clock { + my $response = qx/watchman clock "$git_work_tree"/; + die "Failed to get clock id on '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + return $json_pkg->new->utf8->decode($response); +} + +sub watchman_query { + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $last_update_token but not from the .git folder. + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + if (substr($last_update_token, 0, 1) eq "c") { + $last_update_token = "\"$last_update_token\""; + } + my $query = <<" END"; + ["query", "$git_work_tree", { + "since": $last_update_token, + "fields": ["name"], + "expression": ["not", ["dirname", ".git"]] + }] + END + + # Uncomment for debugging the watchman query + # open (my $fh, ">", ".git/watchman-query.json"); + # print $fh $query; + # close $fh; + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; }; + + # Uncomment for debugging the watch response + # open ($fh, ">", ".git/watchman-response.json"); + # print $fh $response; + # close $fh; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + return $json_pkg->new->utf8->decode($response); +} + +sub is_work_tree_watched { + my ($output) = @_; + my $error = $output->{error}; + if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { + $retry--; + my $response = qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + $output = $json_pkg->new->utf8->decode($response); + $error = $output->{error}; + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # close $fh; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + my $o = watchman_clock(); + $error = $output->{error}; + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + output_result($o->{clock}, ("/")); + $last_update_token = $o->{clock}; + + eval { launch_watchman() }; + return 0; + } + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + return 1; +} + +sub get_working_dir { + my $working_dir; + if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $working_dir = Win32::GetCwd(); + $working_dir =~ tr/\\/\//; + } else { + require Cwd; + $working_dir = Cwd::cwd(); + } + + return $working_dir; +} diff --git a/.old.git/hooks/post-update.sample b/.old.git/hooks/post-update.sample new file mode 100755 index 0000000..ec17ec1 --- /dev/null +++ b/.old.git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/.old.git/hooks/pre-applypatch.sample b/.old.git/hooks/pre-applypatch.sample new file mode 100755 index 0000000..4142082 --- /dev/null +++ b/.old.git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/.old.git/hooks/pre-commit.sample b/.old.git/hooks/pre-commit.sample new file mode 100755 index 0000000..e144712 --- /dev/null +++ b/.old.git/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/.old.git/hooks/pre-merge-commit.sample b/.old.git/hooks/pre-merge-commit.sample new file mode 100755 index 0000000..399eab1 --- /dev/null +++ b/.old.git/hooks/pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/.old.git/hooks/pre-push.sample b/.old.git/hooks/pre-push.sample new file mode 100755 index 0000000..4ce688d --- /dev/null +++ b/.old.git/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/.old.git/hooks/pre-rebase.sample b/.old.git/hooks/pre-rebase.sample new file mode 100755 index 0000000..6cbef5c --- /dev/null +++ b/.old.git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/.old.git/hooks/pre-receive.sample b/.old.git/hooks/pre-receive.sample new file mode 100755 index 0000000..a1fd29e --- /dev/null +++ b/.old.git/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/.old.git/hooks/prepare-commit-msg.sample b/.old.git/hooks/prepare-commit-msg.sample new file mode 100755 index 0000000..10fa14c --- /dev/null +++ b/.old.git/hooks/prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/.old.git/hooks/push-to-checkout.sample b/.old.git/hooks/push-to-checkout.sample new file mode 100755 index 0000000..af5a0c0 --- /dev/null +++ b/.old.git/hooks/push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/.old.git/index b/.old.git/index new file mode 100644 index 0000000..4644bbe Binary files /dev/null and b/.old.git/index differ diff --git a/.old.git/info/exclude b/.old.git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/.old.git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/.old.git/logs/HEAD b/.old.git/logs/HEAD new file mode 100644 index 0000000..d5cc24b --- /dev/null +++ b/.old.git/logs/HEAD @@ -0,0 +1,90 @@ +0000000000000000000000000000000000000000 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 uhryniuk 1768348076 -0600 clone: from gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002.git +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 uhryniuk 1768350271 -0600 checkout: moving from main to 0001/add-go-webserver +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 be723bf91dbc13af52d7f73b5f15467cef0c7f1b uhryniuk 1768350423 -0600 commit: feat(webserver): add initial go webserver +be723bf91dbc13af52d7f73b5f15467cef0c7f1b 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 uhryniuk 1768350623 -0600 checkout: moving from 0001/add-go-webserver to main +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 uhryniuk 1768350629 -0600 checkout: moving from main to 2-create-a-simple-go-webserver +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 uhryniuk 1768350645 -0600 commit: feat(webserver): add initial go webserver +e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 uhryniuk 1768350805 -0600 checkout: moving from 2-create-a-simple-go-webserver to 3-containerize-service +e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 7bf2a817f97e785d0b1682202df37f5934d4e153 uhryniuk 1768351674 -0600 commit: feat(docker): add Dockerfile to run Go webserver +7bf2a817f97e785d0b1682202df37f5934d4e153 e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 uhryniuk 1768351680 -0600 checkout: moving from 3-containerize-service to 2-create-a-simple-go-webserver +e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351690 -0600 commit (amend): feat(webserver): add initial go webserver +2994726718040e9b7d1f95b5957ada28d5b03b8e 7bf2a817f97e785d0b1682202df37f5934d4e153 uhryniuk 1768351696 -0600 checkout: moving from 2-create-a-simple-go-webserver to 3-containerize-service +7bf2a817f97e785d0b1682202df37f5934d4e153 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351702 -0600 checkout: moving from 3-containerize-service to 2-create-a-simple-go-webserver +2994726718040e9b7d1f95b5957ada28d5b03b8e 7bf2a817f97e785d0b1682202df37f5934d4e153 uhryniuk 1768351708 -0600 checkout: moving from 2-create-a-simple-go-webserver to 3-containerize-service +7bf2a817f97e785d0b1682202df37f5934d4e153 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351711 -0600 rebase (start): checkout 2-create-a-simple-go-webserver +2994726718040e9b7d1f95b5957ada28d5b03b8e d56866897ff630c6a6027cd434006d575d5b70d4 uhryniuk 1768351711 -0600 rebase (pick): feat(webserver): add initial go webserver +d56866897ff630c6a6027cd434006d575d5b70d4 0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 uhryniuk 1768351711 -0600 rebase (pick): feat(docker): add Dockerfile to run Go webserver +0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 uhryniuk 1768351711 -0600 rebase (finish): returning to refs/heads/3-containerize-service +0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 uhryniuk 1768351739 -0600 rebase (start): checkout 2-create-a-simple-go-webserver +0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 uhryniuk 1768351739 -0600 rebase (finish): returning to refs/heads/3-containerize-service +0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351751 -0600 checkout: moving from 3-containerize-service to 2-create-a-simple-go-webserver +2994726718040e9b7d1f95b5957ada28d5b03b8e 0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 uhryniuk 1768351756 -0600 checkout: moving from 2-create-a-simple-go-webserver to 3-containerize-service +0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 d56866897ff630c6a6027cd434006d575d5b70d4 uhryniuk 1768351778 -0600 rebase (start): checkout 2-create-a-simple-go-webserver +d56866897ff630c6a6027cd434006d575d5b70d4 0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 uhryniuk 1768351778 -0600 rebase: fast-forward +0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 uhryniuk 1768351778 -0600 rebase (reword): feat(docker): add Dockerfile to run Go webserver +832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 uhryniuk 1768351778 -0600 rebase (finish): returning to refs/heads/3-containerize-service +832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351888 -0600 checkout: moving from 3-containerize-service to 2-create-a-simple-go-webserver +2994726718040e9b7d1f95b5957ada28d5b03b8e 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351906 -0600 checkout: moving from 2-create-a-simple-go-webserver to 3-create-docker-image +2994726718040e9b7d1f95b5957ada28d5b03b8e 0e9ab644abb82b38dc6b0cd348176b7435f93cc4 uhryniuk 1768351922 -0600 commit: feat(docker): add Dockerfile to run Go webserver +0e9ab644abb82b38dc6b0cd348176b7435f93cc4 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351935 -0600 rebase (start): checkout 2-create-a-simple-go-webserver +2994726718040e9b7d1f95b5957ada28d5b03b8e 0e9ab644abb82b38dc6b0cd348176b7435f93cc4 uhryniuk 1768351935 -0600 rebase: fast-forward +0e9ab644abb82b38dc6b0cd348176b7435f93cc4 215114744cd70b97ece95891cef7f207a746af49 uhryniuk 1768351935 -0600 rebase (reword): feat(docker): add Dockerfile to run Go webserver +215114744cd70b97ece95891cef7f207a746af49 215114744cd70b97ece95891cef7f207a746af49 uhryniuk 1768351935 -0600 rebase (finish): returning to refs/heads/3-create-docker-image +215114744cd70b97ece95891cef7f207a746af49 fa5b934ed6c6536c8f63dd2463d77a9c15218d9c uhryniuk 1768352100 -0600 commit (amend): feat(docker): add Dockerfile to run Go webserver +fa5b934ed6c6536c8f63dd2463d77a9c15218d9c fa5b934ed6c6536c8f63dd2463d77a9c15218d9c uhryniuk 1768352198 -0600 checkout: moving from 3-create-docker-image to 6-create-a-helm-chart-for-deployment +fa5b934ed6c6536c8f63dd2463d77a9c15218d9c 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768353565 -0600 commit: feat(helm): add helm chart and update README +1f83c1106dcd22a7e34bd38e57933d06b87c7968 3c64f1f7d13cc02274aae52b595637091cab62f6 uhryniuk 1768353865 -0600 commit: feat(ci): add gitlab CI for build, test and validation +3c64f1f7d13cc02274aae52b595637091cab62f6 7a6466e794b8df0c6d5402a87baa995ff5763e56 uhryniuk 1768354058 -0600 commit (amend): feat(ci): add gitlab CI for build, test and validation +7a6466e794b8df0c6d5402a87baa995ff5763e56 7a6466e794b8df0c6d5402a87baa995ff5763e56 uhryniuk 1768354098 -0600 rebase (start): checkout refs/remotes/origin/6-create-a-helm-chart-for-deployment +7a6466e794b8df0c6d5402a87baa995ff5763e56 7a6466e794b8df0c6d5402a87baa995ff5763e56 uhryniuk 1768354098 -0600 rebase (finish): returning to refs/heads/6-create-a-helm-chart-for-deployment +7a6466e794b8df0c6d5402a87baa995ff5763e56 fa5b934ed6c6536c8f63dd2463d77a9c15218d9c uhryniuk 1768354101 -0600 checkout: moving from 6-create-a-helm-chart-for-deployment to 3-create-docker-image +fa5b934ed6c6536c8f63dd2463d77a9c15218d9c 7a6466e794b8df0c6d5402a87baa995ff5763e56 uhryniuk 1768354109 -0600 checkout: moving from 3-create-docker-image to 6-create-a-helm-chart-for-deployment +7a6466e794b8df0c6d5402a87baa995ff5763e56 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768354165 -0600 reset: moving to HEAD~1 +1f83c1106dcd22a7e34bd38e57933d06b87c7968 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768354226 -0600 checkout: moving from 6-create-a-helm-chart-for-deployment to 5-implement-ci-pipeline +1f83c1106dcd22a7e34bd38e57933d06b87c7968 18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 uhryniuk 1768354240 -0600 commit: feat(ci): add gitlab CI for build, test and validation +18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768354267 -0600 checkout: moving from 5-implement-ci-pipeline to 6-create-a-helm-chart-for-deployment +1f83c1106dcd22a7e34bd38e57933d06b87c7968 18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 uhryniuk 1768354275 -0600 checkout: moving from 6-create-a-helm-chart-for-deployment to 5-implement-ci-pipeline +18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 uhryniuk 1768354278 -0600 rebase (start): checkout refs/remotes/origin/5-implement-ci-pipeline +18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 uhryniuk 1768354278 -0600 rebase (finish): returning to refs/heads/5-implement-ci-pipeline +18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768354284 -0600 rebase (start): checkout 6-create-a-helm-chart-for-deployment +1f83c1106dcd22a7e34bd38e57933d06b87c7968 18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 uhryniuk 1768354284 -0600 rebase: fast-forward +18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768354284 -0600 rebase (reword): feat(ci): add gitlab CI for build, test and validation +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768354284 -0600 rebase (finish): returning to refs/heads/5-implement-ci-pipeline +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768354863 -0600 checkout: moving from 5-implement-ci-pipeline to 4-document-go-application +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768355090 -0600 commit: feat(README): Update README to reflect recent commits +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768424775 -0600 checkout: moving from 4-document-go-application to 5-implement-ci-pipeline +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768424784 -0600 checkout: moving from 5-implement-ci-pipeline to fix/ci +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 a6f70088c336a5ab9817abbad58c18c7e6e3b4f9 uhryniuk 1768424799 -0600 commit: feat(ci): update CI to check helm failures +a6f70088c336a5ab9817abbad58c18c7e6e3b4f9 f22b3ccf33a8ffcdff901e5ea02d75e5d43b0b3f uhryniuk 1768424975 -0600 commit (amend): feat(ci): update CI to check helm failures +f22b3ccf33a8ffcdff901e5ea02d75e5d43b0b3f ae2b294f12740f9dce06a249e941eda5703ccdd7 uhryniuk 1768425191 -0600 commit (amend): feat(ci): update CI to check helm failures +ae2b294f12740f9dce06a249e941eda5703ccdd7 4077c05cfb9fe153e27aedacdb61a7761fa12920 uhryniuk 1768425401 -0600 pull: Fast-forward +4077c05cfb9fe153e27aedacdb61a7761fa12920 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768425480 -0600 checkout: moving from fix/ci to 5-implement-ci-pipeline +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768425508 -0600 commit (amend): feat(ci): add gitlab CI for build, test and validation +4e45344d9401565cf82acb82932ccb11635a2b48 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768425552 -0600 checkout: moving from 5-implement-ci-pipeline to 4-document-go-application +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768425555 -0600 rebase (start): checkout 5-implement-ci-pipeline +4e45344d9401565cf82acb82932ccb11635a2b48 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768425562 -0600 rebase (abort): updating HEAD +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768425669 -0600 rebase (start): checkout 5-implement-ci-pipeline +4e45344d9401565cf82acb82932ccb11635a2b48 94eabe9e22b4502ee1930330d439c25c57ef05fd uhryniuk 1768425755 -0600 rebase (continue): feat(ci): add gitlab CI for build, test and validation +94eabe9e22b4502ee1930330d439c25c57ef05fd b21a999af710bda04355f9f931924be11c6b8484 uhryniuk 1768425760 -0600 rebase (continue) (pick): feat(README): Update README to reflect recent commits +b21a999af710bda04355f9f931924be11c6b8484 b21a999af710bda04355f9f931924be11c6b8484 uhryniuk 1768425760 -0600 rebase (continue) (finish): returning to refs/heads/4-document-go-application +b21a999af710bda04355f9f931924be11c6b8484 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768425771 -0600 checkout: moving from 4-document-go-application to 5-implement-ci-pipeline +4e45344d9401565cf82acb82932ccb11635a2b48 b21a999af710bda04355f9f931924be11c6b8484 uhryniuk 1768425827 -0600 checkout: moving from 5-implement-ci-pipeline to 4-document-go-application +b21a999af710bda04355f9f931924be11c6b8484 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768425837 -0600 reset: moving to origin/4-document-go-application +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768432177 -0600 checkout: moving from 4-document-go-application to 5-implement-ci-pipeline +4e45344d9401565cf82acb82932ccb11635a2b48 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768432192 -0600 checkout: moving from 5-implement-ci-pipeline to 4-document-go-application +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768432201 -0600 rebase (start): checkout 5-implement-ci-pipeline +4e45344d9401565cf82acb82932ccb11635a2b48 cd129a893d65e2deb757301b6e8d1329289ebffb uhryniuk 1768432216 -0600 rebase (continue): feat(ci): add gitlab CI for build, test and validation +cd129a893d65e2deb757301b6e8d1329289ebffb 66ef02514f8e485d83fe4ebc3098ff1946d35b3b uhryniuk 1768432231 -0600 rebase (continue) (pick): feat(README): Update README to reflect recent commits +66ef02514f8e485d83fe4ebc3098ff1946d35b3b 66ef02514f8e485d83fe4ebc3098ff1946d35b3b uhryniuk 1768432231 -0600 rebase (continue) (finish): returning to refs/heads/4-document-go-application +66ef02514f8e485d83fe4ebc3098ff1946d35b3b 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768432239 -0600 checkout: moving from 4-document-go-application to 5-implement-ci-pipeline +4e45344d9401565cf82acb82932ccb11635a2b48 66ef02514f8e485d83fe4ebc3098ff1946d35b3b uhryniuk 1768432274 -0600 checkout: moving from 5-implement-ci-pipeline to 4-document-go-application +66ef02514f8e485d83fe4ebc3098ff1946d35b3b 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768432282 -0600 reset: moving to origin/4-document-go-application +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768432312 -0600 checkout: moving from 4-document-go-application to 5-implement-ci-pipeline +4e45344d9401565cf82acb82932ccb11635a2b48 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768432317 -0600 checkout: moving from 5-implement-ci-pipeline to 4-document-go-application +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768432464 -0600 rebase (start): checkout 5-implement-ci-pipeline +4e45344d9401565cf82acb82932ccb11635a2b48 b6a801720d7653823d15c1d53e5dd2d96613030d uhryniuk 1768432464 -0600 rebase (pick): feat(README): Update README to reflect recent commits +b6a801720d7653823d15c1d53e5dd2d96613030d b6a801720d7653823d15c1d53e5dd2d96613030d uhryniuk 1768432464 -0600 rebase (finish): returning to refs/heads/4-document-go-application +b6a801720d7653823d15c1d53e5dd2d96613030d 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768432480 -0600 checkout: moving from 4-document-go-application to 5-implement-ci-pipeline +4e45344d9401565cf82acb82932ccb11635a2b48 b6a801720d7653823d15c1d53e5dd2d96613030d uhryniuk 1768432486 -0600 checkout: moving from 5-implement-ci-pipeline to 4-document-go-application +b6a801720d7653823d15c1d53e5dd2d96613030d 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 uhryniuk 1768529236 -0600 checkout: moving from 4-document-go-application to main +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 b6a801720d7653823d15c1d53e5dd2d96613030d uhryniuk 1768529788 -0600 checkout: moving from main to 4-document-go-application diff --git a/.old.git/logs/refs/heads/0001/add-go-webserver b/.old.git/logs/refs/heads/0001/add-go-webserver new file mode 100644 index 0000000..f48feb0 --- /dev/null +++ b/.old.git/logs/refs/heads/0001/add-go-webserver @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 uhryniuk 1768350271 -0600 branch: Created from HEAD +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 be723bf91dbc13af52d7f73b5f15467cef0c7f1b uhryniuk 1768350423 -0600 commit: feat(webserver): add initial go webserver diff --git a/.old.git/logs/refs/heads/2-create-a-simple-go-webserver b/.old.git/logs/refs/heads/2-create-a-simple-go-webserver new file mode 100644 index 0000000..c5f2945 --- /dev/null +++ b/.old.git/logs/refs/heads/2-create-a-simple-go-webserver @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 uhryniuk 1768350629 -0600 branch: Created from refs/remotes/origin/2-create-a-simple-go-webserver +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 uhryniuk 1768350645 -0600 commit: feat(webserver): add initial go webserver +e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351690 -0600 commit (amend): feat(webserver): add initial go webserver diff --git a/.old.git/logs/refs/heads/3-containerize-service b/.old.git/logs/refs/heads/3-containerize-service new file mode 100644 index 0000000..7b9f042 --- /dev/null +++ b/.old.git/logs/refs/heads/3-containerize-service @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 uhryniuk 1768350805 -0600 branch: Created from HEAD +e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 7bf2a817f97e785d0b1682202df37f5934d4e153 uhryniuk 1768351674 -0600 commit: feat(docker): add Dockerfile to run Go webserver +7bf2a817f97e785d0b1682202df37f5934d4e153 0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 uhryniuk 1768351711 -0600 rebase (finish): refs/heads/3-containerize-service onto 2994726718040e9b7d1f95b5957ada28d5b03b8e +0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 uhryniuk 1768351778 -0600 rebase (finish): refs/heads/3-containerize-service onto 2994726718040e9b7d1f95b5957ada28d5b03b8e diff --git a/.old.git/logs/refs/heads/3-create-docker-image b/.old.git/logs/refs/heads/3-create-docker-image new file mode 100644 index 0000000..18af222 --- /dev/null +++ b/.old.git/logs/refs/heads/3-create-docker-image @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351906 -0600 branch: Created from HEAD +2994726718040e9b7d1f95b5957ada28d5b03b8e 0e9ab644abb82b38dc6b0cd348176b7435f93cc4 uhryniuk 1768351922 -0600 commit: feat(docker): add Dockerfile to run Go webserver +0e9ab644abb82b38dc6b0cd348176b7435f93cc4 215114744cd70b97ece95891cef7f207a746af49 uhryniuk 1768351935 -0600 rebase (finish): refs/heads/3-create-docker-image onto 2994726718040e9b7d1f95b5957ada28d5b03b8e +215114744cd70b97ece95891cef7f207a746af49 fa5b934ed6c6536c8f63dd2463d77a9c15218d9c uhryniuk 1768352100 -0600 commit (amend): feat(docker): add Dockerfile to run Go webserver diff --git a/.old.git/logs/refs/heads/4-document-go-application b/.old.git/logs/refs/heads/4-document-go-application new file mode 100644 index 0000000..0d44e1b --- /dev/null +++ b/.old.git/logs/refs/heads/4-document-go-application @@ -0,0 +1,7 @@ +0000000000000000000000000000000000000000 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768354863 -0600 branch: Created from HEAD +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768355090 -0600 commit: feat(README): Update README to reflect recent commits +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd b21a999af710bda04355f9f931924be11c6b8484 uhryniuk 1768425760 -0600 rebase (continue) (finish): refs/heads/4-document-go-application onto 4e45344d9401565cf82acb82932ccb11635a2b48 +b21a999af710bda04355f9f931924be11c6b8484 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768425837 -0600 reset: moving to origin/4-document-go-application +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd 66ef02514f8e485d83fe4ebc3098ff1946d35b3b uhryniuk 1768432231 -0600 rebase (continue) (finish): refs/heads/4-document-go-application onto 4e45344d9401565cf82acb82932ccb11635a2b48 +66ef02514f8e485d83fe4ebc3098ff1946d35b3b 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768432282 -0600 reset: moving to origin/4-document-go-application +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd b6a801720d7653823d15c1d53e5dd2d96613030d uhryniuk 1768432464 -0600 rebase (finish): refs/heads/4-document-go-application onto 4e45344d9401565cf82acb82932ccb11635a2b48 diff --git a/.old.git/logs/refs/heads/5-implement-ci-pipeline b/.old.git/logs/refs/heads/5-implement-ci-pipeline new file mode 100644 index 0000000..92aa27d --- /dev/null +++ b/.old.git/logs/refs/heads/5-implement-ci-pipeline @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768354226 -0600 branch: Created from HEAD +1f83c1106dcd22a7e34bd38e57933d06b87c7968 18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 uhryniuk 1768354240 -0600 commit: feat(ci): add gitlab CI for build, test and validation +18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768354284 -0600 rebase (finish): refs/heads/5-implement-ci-pipeline onto 1f83c1106dcd22a7e34bd38e57933d06b87c7968 +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768425508 -0600 commit (amend): feat(ci): add gitlab CI for build, test and validation diff --git a/.old.git/logs/refs/heads/6-create-a-helm-chart-for-deployment b/.old.git/logs/refs/heads/6-create-a-helm-chart-for-deployment new file mode 100644 index 0000000..afba910 --- /dev/null +++ b/.old.git/logs/refs/heads/6-create-a-helm-chart-for-deployment @@ -0,0 +1,5 @@ +0000000000000000000000000000000000000000 fa5b934ed6c6536c8f63dd2463d77a9c15218d9c uhryniuk 1768352198 -0600 branch: Created from HEAD +fa5b934ed6c6536c8f63dd2463d77a9c15218d9c 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768353565 -0600 commit: feat(helm): add helm chart and update README +1f83c1106dcd22a7e34bd38e57933d06b87c7968 3c64f1f7d13cc02274aae52b595637091cab62f6 uhryniuk 1768353865 -0600 commit: feat(ci): add gitlab CI for build, test and validation +3c64f1f7d13cc02274aae52b595637091cab62f6 7a6466e794b8df0c6d5402a87baa995ff5763e56 uhryniuk 1768354058 -0600 commit (amend): feat(ci): add gitlab CI for build, test and validation +7a6466e794b8df0c6d5402a87baa995ff5763e56 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768354165 -0600 reset: moving to HEAD~1 diff --git a/.old.git/logs/refs/heads/fix/ci b/.old.git/logs/refs/heads/fix/ci new file mode 100644 index 0000000..53cbdad --- /dev/null +++ b/.old.git/logs/refs/heads/fix/ci @@ -0,0 +1,5 @@ +0000000000000000000000000000000000000000 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768424784 -0600 branch: Created from HEAD +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 a6f70088c336a5ab9817abbad58c18c7e6e3b4f9 uhryniuk 1768424799 -0600 commit: feat(ci): update CI to check helm failures +a6f70088c336a5ab9817abbad58c18c7e6e3b4f9 f22b3ccf33a8ffcdff901e5ea02d75e5d43b0b3f uhryniuk 1768424975 -0600 commit (amend): feat(ci): update CI to check helm failures +f22b3ccf33a8ffcdff901e5ea02d75e5d43b0b3f ae2b294f12740f9dce06a249e941eda5703ccdd7 uhryniuk 1768425191 -0600 commit (amend): feat(ci): update CI to check helm failures +ae2b294f12740f9dce06a249e941eda5703ccdd7 4077c05cfb9fe153e27aedacdb61a7761fa12920 uhryniuk 1768425401 -0600 pull: Fast-forward diff --git a/.old.git/logs/refs/heads/main b/.old.git/logs/refs/heads/main new file mode 100644 index 0000000..3ea65fb --- /dev/null +++ b/.old.git/logs/refs/heads/main @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 uhryniuk 1768348076 -0600 clone: from gitlab.com:gl-technical-interviews/backend/gitlab-delivery/interview-256744228002.git diff --git a/.old.git/logs/refs/remotes/gitlab/0001/add-go-webserver b/.old.git/logs/refs/remotes/gitlab/0001/add-go-webserver new file mode 100644 index 0000000..2a2fe3d --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/0001/add-go-webserver @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 be723bf91dbc13af52d7f73b5f15467cef0c7f1b uhryniuk 1768350437 -0600 update by push +be723bf91dbc13af52d7f73b5f15467cef0c7f1b be723bf91dbc13af52d7f73b5f15467cef0c7f1b dylan 1768529172 -0600 remote: renamed refs/remotes/origin/0001/add-go-webserver to refs/remotes/gitlab/0001/add-go-webserver diff --git a/.old.git/logs/refs/remotes/gitlab/2-create-a-simple-go-webserver b/.old.git/logs/refs/remotes/gitlab/2-create-a-simple-go-webserver new file mode 100644 index 0000000..7da347b --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/2-create-a-simple-go-webserver @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 uhryniuk 1768350627 -0600 fetch --append --no-auto-gc --no-write-commit-graph origin: storing head +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 uhryniuk 1768350650 -0600 update by push +e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 2994726718040e9b7d1f95b5957ada28d5b03b8e uhryniuk 1768351694 -0600 update by push +2994726718040e9b7d1f95b5957ada28d5b03b8e 2994726718040e9b7d1f95b5957ada28d5b03b8e dylan 1768529172 -0600 remote: renamed refs/remotes/origin/2-create-a-simple-go-webserver to refs/remotes/gitlab/2-create-a-simple-go-webserver diff --git a/.old.git/logs/refs/remotes/gitlab/3-containerize-service b/.old.git/logs/refs/remotes/gitlab/3-containerize-service new file mode 100644 index 0000000..244b9ba --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/3-containerize-service @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 uhryniuk 1768350817 -0600 update by push +e1b7c9abb78f9151419d7814e4e9ad2d1ca561e1 0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 uhryniuk 1768351723 -0600 update by push +0b013d45d02aaf7f0bba716d5e7ab743cbd3ff59 832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 uhryniuk 1768351821 -0600 update by push +832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 dylan 1768529172 -0600 remote: renamed refs/remotes/origin/3-containerize-service to refs/remotes/gitlab/3-containerize-service diff --git a/.old.git/logs/refs/remotes/gitlab/3-create-docker-image b/.old.git/logs/refs/remotes/gitlab/3-create-docker-image new file mode 100644 index 0000000..d669557 --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/3-create-docker-image @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 215114744cd70b97ece95891cef7f207a746af49 uhryniuk 1768351951 -0600 update by push +215114744cd70b97ece95891cef7f207a746af49 fa5b934ed6c6536c8f63dd2463d77a9c15218d9c uhryniuk 1768352107 -0600 update by push +fa5b934ed6c6536c8f63dd2463d77a9c15218d9c fa5b934ed6c6536c8f63dd2463d77a9c15218d9c dylan 1768529172 -0600 remote: renamed refs/remotes/origin/3-create-docker-image to refs/remotes/gitlab/3-create-docker-image diff --git a/.old.git/logs/refs/remotes/gitlab/4-document-go-application b/.old.git/logs/refs/remotes/gitlab/4-document-go-application new file mode 100644 index 0000000..bc0da3b --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/4-document-go-application @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768354871 -0600 update by push +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 1a67ef15921ef04eb5d07f8880e3fd5b15baaedd uhryniuk 1768355093 -0600 update by push +1a67ef15921ef04eb5d07f8880e3fd5b15baaedd b6a801720d7653823d15c1d53e5dd2d96613030d uhryniuk 1768432497 -0600 update by push +b6a801720d7653823d15c1d53e5dd2d96613030d b6a801720d7653823d15c1d53e5dd2d96613030d dylan 1768529172 -0600 remote: renamed refs/remotes/origin/4-document-go-application to refs/remotes/gitlab/4-document-go-application diff --git a/.old.git/logs/refs/remotes/gitlab/5-implement-ci-pipeline b/.old.git/logs/refs/remotes/gitlab/5-implement-ci-pipeline new file mode 100644 index 0000000..91b84d8 --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/5-implement-ci-pipeline @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 uhryniuk 1768354250 -0600 update by push +18cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 uhryniuk 1768354295 -0600 update by push +2a23fb1c6bdecbb3e2e2d398b6d70327011da8e2 4e45344d9401565cf82acb82932ccb11635a2b48 uhryniuk 1768425510 -0600 update by push +4e45344d9401565cf82acb82932ccb11635a2b48 4e45344d9401565cf82acb82932ccb11635a2b48 dylan 1768529172 -0600 remote: renamed refs/remotes/origin/5-implement-ci-pipeline to refs/remotes/gitlab/5-implement-ci-pipeline diff --git a/.old.git/logs/refs/remotes/gitlab/6-create-a-helm-chart-for-deployment b/.old.git/logs/refs/remotes/gitlab/6-create-a-helm-chart-for-deployment new file mode 100644 index 0000000..35658ae --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/6-create-a-helm-chart-for-deployment @@ -0,0 +1,5 @@ +0000000000000000000000000000000000000000 fa5b934ed6c6536c8f63dd2463d77a9c15218d9c uhryniuk 1768352206 -0600 update by push +fa5b934ed6c6536c8f63dd2463d77a9c15218d9c 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768353568 -0600 update by push +1f83c1106dcd22a7e34bd38e57933d06b87c7968 7a6466e794b8df0c6d5402a87baa995ff5763e56 uhryniuk 1768354076 -0600 update by push +7a6466e794b8df0c6d5402a87baa995ff5763e56 1f83c1106dcd22a7e34bd38e57933d06b87c7968 uhryniuk 1768354206 -0600 update by push +1f83c1106dcd22a7e34bd38e57933d06b87c7968 1f83c1106dcd22a7e34bd38e57933d06b87c7968 dylan 1768529172 -0600 remote: renamed refs/remotes/origin/6-create-a-helm-chart-for-deployment to refs/remotes/gitlab/6-create-a-helm-chart-for-deployment diff --git a/.old.git/logs/refs/remotes/gitlab/HEAD b/.old.git/logs/refs/remotes/gitlab/HEAD new file mode 100644 index 0000000..11bbb33 --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 dylan 1768529172 -0600 remote: renamed refs/remotes/origin/HEAD to refs/remotes/gitlab/HEAD diff --git a/.old.git/logs/refs/remotes/gitlab/fix/ci b/.old.git/logs/refs/remotes/gitlab/fix/ci new file mode 100644 index 0000000..be61631 --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/fix/ci @@ -0,0 +1,5 @@ +0000000000000000000000000000000000000000 a6f70088c336a5ab9817abbad58c18c7e6e3b4f9 uhryniuk 1768424808 -0600 update by push +a6f70088c336a5ab9817abbad58c18c7e6e3b4f9 f22b3ccf33a8ffcdff901e5ea02d75e5d43b0b3f uhryniuk 1768424977 -0600 update by push +f22b3ccf33a8ffcdff901e5ea02d75e5d43b0b3f ae2b294f12740f9dce06a249e941eda5703ccdd7 uhryniuk 1768425193 -0600 update by push +ae2b294f12740f9dce06a249e941eda5703ccdd7 4077c05cfb9fe153e27aedacdb61a7761fa12920 uhryniuk 1768425401 -0600 pull: fast-forward +4077c05cfb9fe153e27aedacdb61a7761fa12920 4077c05cfb9fe153e27aedacdb61a7761fa12920 dylan 1768529172 -0600 remote: renamed refs/remotes/origin/fix/ci to refs/remotes/gitlab/fix/ci diff --git a/.old.git/logs/refs/remotes/gitlab/main b/.old.git/logs/refs/remotes/gitlab/main new file mode 100644 index 0000000..c85b2cd --- /dev/null +++ b/.old.git/logs/refs/remotes/gitlab/main @@ -0,0 +1 @@ +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 dylan 1768529172 -0600 remote: renamed refs/remotes/origin/main to refs/remotes/gitlab/main diff --git a/.old.git/objects/02/f0021fc12a19b17177fec311d25632ff06fee6 b/.old.git/objects/02/f0021fc12a19b17177fec311d25632ff06fee6 new file mode 100644 index 0000000..9e1a260 Binary files /dev/null and b/.old.git/objects/02/f0021fc12a19b17177fec311d25632ff06fee6 differ diff --git a/.old.git/objects/06/b68a64506292908579785d0860b6fb0b772485 b/.old.git/objects/06/b68a64506292908579785d0860b6fb0b772485 new file mode 100644 index 0000000..78be6b4 Binary files /dev/null and b/.old.git/objects/06/b68a64506292908579785d0860b6fb0b772485 differ diff --git a/.old.git/objects/0b/013d45d02aaf7f0bba716d5e7ab743cbd3ff59 b/.old.git/objects/0b/013d45d02aaf7f0bba716d5e7ab743cbd3ff59 new file mode 100644 index 0000000..3389184 Binary files /dev/null and b/.old.git/objects/0b/013d45d02aaf7f0bba716d5e7ab743cbd3ff59 differ diff --git a/.old.git/objects/0b/9d31bc7ebeb165f2324a3f238c37726a321cf7 b/.old.git/objects/0b/9d31bc7ebeb165f2324a3f238c37726a321cf7 new file mode 100644 index 0000000..d79ae82 --- /dev/null +++ b/.old.git/objects/0b/9d31bc7ebeb165f2324a3f238c37726a321cf7 @@ -0,0 +1 @@ +x=K0 DYVDiwpn0RXNԊc>b5̛%t +[Zf&(R:&+ܸ%y x??ˤ%ћ~cCg!. \ No newline at end of file diff --git a/.old.git/objects/0c/592f1dd509fbc44209b35b580c29c889c3af43 b/.old.git/objects/0c/592f1dd509fbc44209b35b580c29c889c3af43 new file mode 100644 index 0000000..70b938a Binary files /dev/null and b/.old.git/objects/0c/592f1dd509fbc44209b35b580c29c889c3af43 differ diff --git a/.old.git/objects/0e/8a0eb36f4ca2c939201c0d54b5d82a1ea34778 b/.old.git/objects/0e/8a0eb36f4ca2c939201c0d54b5d82a1ea34778 new file mode 100644 index 0000000..f99109a --- /dev/null +++ b/.old.git/objects/0e/8a0eb36f4ca2c939201c0d54b5d82a1ea34778 @@ -0,0 +1,4 @@ +xMO1N1+ +h +*Eyc/-wMxfvlcpxWT v=d3Ǫ +USΩ456QAh(0zyM 7>B J@$FtMG mzpTҞZws}wBB/{YߔaOZdAkmX`[1P3# !_3n6+b}uƿ&yY`9#iS.s)V |;ެ6k5BpuQÂ;=GLܬ1,\G \ No newline at end of file diff --git a/.old.git/objects/18/1ae1a8521047091605cd70e5f93876d073466e b/.old.git/objects/18/1ae1a8521047091605cd70e5f93876d073466e new file mode 100644 index 0000000..25272e9 Binary files /dev/null and b/.old.git/objects/18/1ae1a8521047091605cd70e5f93876d073466e differ diff --git a/.old.git/objects/18/cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 b/.old.git/objects/18/cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 new file mode 100644 index 0000000..b94ca1e Binary files /dev/null and b/.old.git/objects/18/cc6ddc0ff1c0c9a6429b1809a2689501d9f8b9 differ diff --git a/.old.git/objects/1a/497d3146ac18ac2953a29209fca36231fd8e84 b/.old.git/objects/1a/497d3146ac18ac2953a29209fca36231fd8e84 new file mode 100644 index 0000000..d30c065 Binary files /dev/null and b/.old.git/objects/1a/497d3146ac18ac2953a29209fca36231fd8e84 differ diff --git a/.old.git/objects/1a/67ef15921ef04eb5d07f8880e3fd5b15baaedd b/.old.git/objects/1a/67ef15921ef04eb5d07f8880e3fd5b15baaedd new file mode 100644 index 0000000..da41db2 --- /dev/null +++ b/.old.git/objects/1a/67ef15921ef04eb5d07f8880e3fd5b15baaedd @@ -0,0 +1 @@ +xON0 䜯$ض)B$8hM@Zpfc4!*D xɵrjhA:\)f(7vƑ5FtJ\$ÒǴBs y'1`qjlAVmw֠qy|v|~y=0\0+l.7ǿ+E`lx[pL<6rukXGôTc',SC  \ No newline at end of file diff --git a/.old.git/objects/1e/679a7f7d80c1f839d22d47b58e01bf3b772bef b/.old.git/objects/1e/679a7f7d80c1f839d22d47b58e01bf3b772bef new file mode 100644 index 0000000..ee24612 Binary files /dev/null and b/.old.git/objects/1e/679a7f7d80c1f839d22d47b58e01bf3b772bef differ diff --git a/.old.git/objects/1f/83c1106dcd22a7e34bd38e57933d06b87c7968 b/.old.git/objects/1f/83c1106dcd22a7e34bd38e57933d06b87c7968 new file mode 100644 index 0000000..862bd8b --- /dev/null +++ b/.old.git/objects/1f/83c1106dcd22a7e34bd38e57933d06b87c7968 @@ -0,0 +1 @@ +xN0 9),q .m!H o%UnM%rl۸۹ W91QJu[2)Ԫ.1-j)zL26ժԶiuI$k4v!c .ᑎbp,kݔTZ}BLI4?e7 %S cO֫ϵy;1[Y09q}4 bfX x;#X[6kϒa˃5# a،)˅rS/><?恧e \ No newline at end of file diff --git a/.old.git/objects/21/5114744cd70b97ece95891cef7f207a746af49 b/.old.git/objects/21/5114744cd70b97ece95891cef7f207a746af49 new file mode 100644 index 0000000..c7e73e2 Binary files /dev/null and b/.old.git/objects/21/5114744cd70b97ece95891cef7f207a746af49 differ diff --git a/.old.git/objects/28/f57c477b502e462492c3631851eeb2f64bc1ec b/.old.git/objects/28/f57c477b502e462492c3631851eeb2f64bc1ec new file mode 100644 index 0000000..a76cca5 Binary files /dev/null and b/.old.git/objects/28/f57c477b502e462492c3631851eeb2f64bc1ec differ diff --git a/.old.git/objects/29/94726718040e9b7d1f95b5957ada28d5b03b8e b/.old.git/objects/29/94726718040e9b7d1f95b5957ada28d5b03b8e new file mode 100644 index 0000000..64f5566 --- /dev/null +++ b/.old.git/objects/29/94726718040e9b7d1f95b5957ada28d5b03b8e @@ -0,0 +1,2 @@ +x͎0 {SRCv;^Es*z/@IT]2m޾r-zQᘸI?D +%''DMgyIY*<; q^"-Ѵգg׻~nF<ͪX%Wl{5ȑЙ~~Ǔ >QJ~[BYAGX>ΔnϾx pw$υ2Y!<@c >Wp>PDk,+wpEh{6氓PWb-xqau)dnsɝZ_kHqxFY#8&bRyKVڂdX shF{<5S'~q \ No newline at end of file diff --git a/.old.git/objects/2a/23fb1c6bdecbb3e2e2d398b6d70327011da8e2 b/.old.git/objects/2a/23fb1c6bdecbb3e2e2d398b6d70327011da8e2 new file mode 100644 index 0000000..f06dbde --- /dev/null +++ b/.old.git/objects/2a/23fb1c6bdecbb3e2e2d398b6d70327011da8e2 @@ -0,0 +1,2 @@ +xAN0EY#TNB Ğ LImUIK+ز< ]@%'^U)mSʑB H@a+g]]&!;' 5qmu ù_usn0%ا3`%DBsLrbKgsk!mT=L!XZXσde7esEx!]D#\Tʃ \ No newline at end of file diff --git a/.old.git/objects/7a/c00779cef47445315068501cd7d87d6dd6ef15 b/.old.git/objects/7a/c00779cef47445315068501cd7d87d6dd6ef15 new file mode 100644 index 0000000..3638ea7 Binary files /dev/null and b/.old.git/objects/7a/c00779cef47445315068501cd7d87d6dd6ef15 differ diff --git a/.old.git/objects/7b/f2a817f97e785d0b1682202df37f5934d4e153 b/.old.git/objects/7b/f2a817f97e785d0b1682202df37f5934d4e153 new file mode 100644 index 0000000..fbc863f Binary files /dev/null and b/.old.git/objects/7b/f2a817f97e785d0b1682202df37f5934d4e153 differ diff --git a/.old.git/objects/7d/13f9812770c7b5c0a5fd503272bf9ecfd7ac10 b/.old.git/objects/7d/13f9812770c7b5c0a5fd503272bf9ecfd7ac10 new file mode 100644 index 0000000..44e5c8f Binary files /dev/null and b/.old.git/objects/7d/13f9812770c7b5c0a5fd503272bf9ecfd7ac10 differ diff --git a/.old.git/objects/7f/19f65c430c9e9aa0ec4d26351bb2f3d64114fd b/.old.git/objects/7f/19f65c430c9e9aa0ec4d26351bb2f3d64114fd new file mode 100644 index 0000000..2c4f54e Binary files /dev/null and b/.old.git/objects/7f/19f65c430c9e9aa0ec4d26351bb2f3d64114fd differ diff --git a/.old.git/objects/83/2faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 b/.old.git/objects/83/2faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 new file mode 100644 index 0000000..7914d01 Binary files /dev/null and b/.old.git/objects/83/2faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 differ diff --git a/.old.git/objects/87/2968615735187baec46322b0e68f64d00c7b8c b/.old.git/objects/87/2968615735187baec46322b0e68f64d00c7b8c new file mode 100644 index 0000000..4eb30b8 Binary files /dev/null and b/.old.git/objects/87/2968615735187baec46322b0e68f64d00c7b8c differ diff --git a/.old.git/objects/89/9127d22f25ad19822425e199b9c67c24dea598 b/.old.git/objects/89/9127d22f25ad19822425e199b9c67c24dea598 new file mode 100644 index 0000000..0406ff8 Binary files /dev/null and b/.old.git/objects/89/9127d22f25ad19822425e199b9c67c24dea598 differ diff --git a/.old.git/objects/94/eabe9e22b4502ee1930330d439c25c57ef05fd b/.old.git/objects/94/eabe9e22b4502ee1930330d439c25c57ef05fd new file mode 100644 index 0000000..4b58f1d --- /dev/null +++ b/.old.git/objects/94/eabe9e22b4502ee1930330d439c25c57ef05fd @@ -0,0 +1,3 @@ +xAN0EY#TNb; B Ğ ImUqK+ز4>h<PF4]vhk Bv8Q,AWRI3t5}SJ5k-:KviMSoc`X4Bժ✕m) +QVʫ g@kas@ J1`Wi΀}}::c1 _IϿ }\3Mohc= ̮G`H9 xp: +#S^3 i%Tb \ No newline at end of file diff --git a/.old.git/objects/95/5637f479a259eb3926570299fd309d44228251 b/.old.git/objects/95/5637f479a259eb3926570299fd309d44228251 new file mode 100644 index 0000000..850803e Binary files /dev/null and b/.old.git/objects/95/5637f479a259eb3926570299fd309d44228251 differ diff --git a/.old.git/objects/9e/ebe8a4b9bc8158763b29fc0935f94eb3b775be b/.old.git/objects/9e/ebe8a4b9bc8158763b29fc0935f94eb3b775be new file mode 100644 index 0000000..bd25a9f Binary files /dev/null and b/.old.git/objects/9e/ebe8a4b9bc8158763b29fc0935f94eb3b775be differ diff --git a/.old.git/objects/9f/7e343db0fb51290a7ece64495367e3c0d6ae3e b/.old.git/objects/9f/7e343db0fb51290a7ece64495367e3c0d6ae3e new file mode 100644 index 0000000..5963e27 Binary files /dev/null and b/.old.git/objects/9f/7e343db0fb51290a7ece64495367e3c0d6ae3e differ diff --git a/.old.git/objects/a6/f70088c336a5ab9817abbad58c18c7e6e3b4f9 b/.old.git/objects/a6/f70088c336a5ab9817abbad58c18c7e6e3b4f9 new file mode 100644 index 0000000..32a1e90 --- /dev/null +++ b/.old.git/objects/a6/f70088c336a5ab9817abbad58c18c7e6e3b4f9 @@ -0,0 +1,2 @@ +x;N1}!``W!qvGc팽2vgN@Jveit.kmcDKEAg=.eԥ"&>eᔬ1%КZgZ(ckN?jip;>@8BQ<: +g./WLCFބo~Je]~/@W \ No newline at end of file diff --git a/.old.git/objects/ae/2b294f12740f9dce06a249e941eda5703ccdd7 b/.old.git/objects/ae/2b294f12740f9dce06a249e941eda5703ccdd7 new file mode 100644 index 0000000..f85c6fa --- /dev/null +++ b/.old.git/objects/ae/2b294f12740f9dce06a249e941eda5703ccdd7 @@ -0,0 +1,3 @@ +x1n!ESs)"^XȊ*A.X +>[$H>}_;^zɺ]3i?aֆE ыe&]L1Z1b stkkFL4Q4R=:`*Lۙ~n޴Z8忉 &T'^_0 +amL6|}X \ No newline at end of file diff --git a/.old.git/objects/ae/3929be2f01a45de9265f8d2da22e717caf2456 b/.old.git/objects/ae/3929be2f01a45de9265f8d2da22e717caf2456 new file mode 100644 index 0000000..878abae Binary files /dev/null and b/.old.git/objects/ae/3929be2f01a45de9265f8d2da22e717caf2456 differ diff --git a/.old.git/objects/b1/b5875304472e6e6379094e3d025ea1474d6a88 b/.old.git/objects/b1/b5875304472e6e6379094e3d025ea1474d6a88 new file mode 100644 index 0000000..c71b2a2 Binary files /dev/null and b/.old.git/objects/b1/b5875304472e6e6379094e3d025ea1474d6a88 differ diff --git a/.old.git/objects/b2/1a999af710bda04355f9f931924be11c6b8484 b/.old.git/objects/b2/1a999af710bda04355f9f931924be11c6b8484 new file mode 100644 index 0000000..856def6 --- /dev/null +++ b/.old.git/objects/b2/1a999af710bda04355f9f931924be11c6b8484 @@ -0,0 +1,2 @@ +xOAN0 WTiҴ B$F&U{Z-wN֌=g=  I-@eIV +BPWwhTf\(f @Q%Fj#Q9e1-v')z2izk{x9+l P]{`0~^w5[ 9B.esǕ*Ӳ€7x{4OgF (%>CڊGv<7+  diff --git a/.old.git/objects/b6/a801720d7653823d15c1d53e5dd2d96613030d b/.old.git/objects/b6/a801720d7653823d15c1d53e5dd2d96613030d new file mode 100644 index 0000000..ee66843 --- /dev/null +++ b/.old.git/objects/b6/a801720d7653823d15c1d53e5dd2d96613030d @@ -0,0 +1,3 @@ +xOAN0 WTi B$ݍM6j;'kƞ i +Wya٢ΓZ7t NWg11fmֽӲ66H6N5D[e +!-S ӈO1@8VG*cp'[)EaKЪѭc~=nc13\0 #S..W!W1}<`[qϷmy1Ľ8q7+ U~ \ No newline at end of file diff --git a/.old.git/objects/b8/7bb0ed42faa79fa7688c12b145f2a908d77a6d b/.old.git/objects/b8/7bb0ed42faa79fa7688c12b145f2a908d77a6d new file mode 100644 index 0000000..1b12569 Binary files /dev/null and b/.old.git/objects/b8/7bb0ed42faa79fa7688c12b145f2a908d77a6d differ diff --git a/.old.git/objects/ba/04a5d3b1feb860e4cbde73e0c7430e177334a0 b/.old.git/objects/ba/04a5d3b1feb860e4cbde73e0c7430e177334a0 new file mode 100644 index 0000000..6107abf Binary files /dev/null and b/.old.git/objects/ba/04a5d3b1feb860e4cbde73e0c7430e177334a0 differ diff --git a/.old.git/objects/be/723bf91dbc13af52d7f73b5f15467cef0c7f1b b/.old.git/objects/be/723bf91dbc13af52d7f73b5f15467cef0c7f1b new file mode 100644 index 0000000..02278f9 --- /dev/null +++ b/.old.git/objects/be/723bf91dbc13af52d7f73b5f15467cef0c7f1b @@ -0,0 +1 @@ +xn0{S\i* >XK-o@{$w1q]}:*J; JNNO 8XMTҩy4v&2ZiEZiGgϮwd8N[yU/%&Kr~5ȑЙ@?I_(h-h@GX>&)(=}<15ߑ?fARXKLP\;,\<_@YD~hhfCلjNB]ucm]޾^]뺕Sݢ;!. -ք;1kg|h aK-Yk cD{͢)V@Lxxd \ No newline at end of file diff --git a/.old.git/objects/cb/7cb51d8ee0b16f630eb351215e95b905507938 b/.old.git/objects/cb/7cb51d8ee0b16f630eb351215e95b905507938 new file mode 100644 index 0000000..49dda5c Binary files /dev/null and b/.old.git/objects/cb/7cb51d8ee0b16f630eb351215e95b905507938 differ diff --git a/.old.git/objects/cd/129a893d65e2deb757301b6e8d1329289ebffb b/.old.git/objects/cd/129a893d65e2deb757301b6e8d1329289ebffb new file mode 100644 index 0000000..6b64644 --- /dev/null +++ b/.old.git/objects/cd/129a893d65e2deb757301b6e8d1329289ebffb @@ -0,0 +1,3 @@ +xN0EY+FbRlvR=?0~6u*qZqK+زsZ P"j|P%D,0%Dȧwg,#x+7sϱP*av!UIofW #n`9!tpzG0&dfKX \ No newline at end of file diff --git a/.old.git/objects/d0/c6e12fe431d4788bd5083ac8e443029e14da4f b/.old.git/objects/d0/c6e12fe431d4788bd5083ac8e443029e14da4f new file mode 100644 index 0000000..05df1dc Binary files /dev/null and b/.old.git/objects/d0/c6e12fe431d4788bd5083ac8e443029e14da4f differ diff --git a/.old.git/objects/d1/8c4700d800c9d7d42384d09563873527d64bf1 b/.old.git/objects/d1/8c4700d800c9d7d42384d09563873527d64bf1 new file mode 100644 index 0000000..4325dc5 Binary files /dev/null and b/.old.git/objects/d1/8c4700d800c9d7d42384d09563873527d64bf1 differ diff --git a/.old.git/objects/d1/b027e12b30f792b3cf2af3c911a28e5934cb50 b/.old.git/objects/d1/b027e12b30f792b3cf2af3c911a28e5934cb50 new file mode 100644 index 0000000..99b9a0e Binary files /dev/null and b/.old.git/objects/d1/b027e12b30f792b3cf2af3c911a28e5934cb50 differ diff --git a/.old.git/objects/d5/6866897ff630c6a6027cd434006d575d5b70d4 b/.old.git/objects/d5/6866897ff630c6a6027cd434006d575d5b70d4 new file mode 100644 index 0000000..4060d65 Binary files /dev/null and b/.old.git/objects/d5/6866897ff630c6a6027cd434006d575d5b70d4 differ diff --git a/.old.git/objects/d6/90c0f1477c5b48847c861daa22d07858a9c70f b/.old.git/objects/d6/90c0f1477c5b48847c861daa22d07858a9c70f new file mode 100644 index 0000000..fb4b0c8 Binary files /dev/null and b/.old.git/objects/d6/90c0f1477c5b48847c861daa22d07858a9c70f differ diff --git a/.old.git/objects/e1/b7c9abb78f9151419d7814e4e9ad2d1ca561e1 b/.old.git/objects/e1/b7c9abb78f9151419d7814e4e9ad2d1ca561e1 new file mode 100644 index 0000000..edccd21 --- /dev/null +++ b/.old.git/objects/e1/b7c9abb78f9151419d7814e4e9ad2d1ca561e1 @@ -0,0 +1 @@ +xͮ0Y)9?NtuEW ^9n qBEY3f<6n/˻@Y5.$q\GZFzXpPb׉@?Y3V7Czן JLе1A]Ӄ} /g9:t6nП˨<)(g)EmE B8/2ҝ҇O/^E+ }L`W7k J`t>|.o|,"?X6m+b Cxن- n1[]}cu1sɝW=դMkZ#G>5pCİxH(LmE2p,عEE`Odԉ?*v# \ No newline at end of file diff --git a/.old.git/objects/e5/73d2049683e78bb65b9e0f6a62086e8024801c b/.old.git/objects/e5/73d2049683e78bb65b9e0f6a62086e8024801c new file mode 100644 index 0000000..0905806 Binary files /dev/null and b/.old.git/objects/e5/73d2049683e78bb65b9e0f6a62086e8024801c differ diff --git a/.old.git/objects/e6/3ff2a253eed08eb62f21058b7a0099aab8bac6 b/.old.git/objects/e6/3ff2a253eed08eb62f21058b7a0099aab8bac6 new file mode 100644 index 0000000..62d4086 Binary files /dev/null and b/.old.git/objects/e6/3ff2a253eed08eb62f21058b7a0099aab8bac6 differ diff --git a/.old.git/objects/f2/2b3ccf33a8ffcdff901e5ea02d75e5d43b0b3f b/.old.git/objects/f2/2b3ccf33a8ffcdff901e5ea02d75e5d43b0b3f new file mode 100644 index 0000000..92b9952 --- /dev/null +++ b/.old.git/objects/f2/2b3ccf33a8ffcdff901e5ea02d75e5d43b0b3f @@ -0,0 +1 @@ +x1n ESs)"VQ)U1XֆboR'ql D@fg)|4 AOLuRwnRN]N1);ơ֙ţXۣlosĥ-~IxOfr!+:y˿Ϳ 紽\a3w/*,ɷ%[W \ No newline at end of file diff --git a/.old.git/objects/f3/acea0a1a92760bed9bdb6e9072e0e0b61d1d1b b/.old.git/objects/f3/acea0a1a92760bed9bdb6e9072e0e0b61d1d1b new file mode 100644 index 0000000..ef68eff Binary files /dev/null and b/.old.git/objects/f3/acea0a1a92760bed9bdb6e9072e0e0b61d1d1b differ diff --git a/.old.git/objects/f6/07d52ea26f85d14a2fa450d01e3010832f298c b/.old.git/objects/f6/07d52ea26f85d14a2fa450d01e3010832f298c new file mode 100644 index 0000000..817dad0 Binary files /dev/null and b/.old.git/objects/f6/07d52ea26f85d14a2fa450d01e3010832f298c differ diff --git a/.old.git/objects/fa/5b934ed6c6536c8f63dd2463d77a9c15218d9c b/.old.git/objects/fa/5b934ed6c6536c8f63dd2463d77a9c15218d9c new file mode 100644 index 0000000..c0fc763 Binary files /dev/null and b/.old.git/objects/fa/5b934ed6c6536c8f63dd2463d77a9c15218d9c differ diff --git a/.old.git/objects/fb/b246ea231aea7d2e47a275a787f368740c0d35 b/.old.git/objects/fb/b246ea231aea7d2e47a275a787f368740c0d35 new file mode 100644 index 0000000..1a6d5f6 Binary files /dev/null and b/.old.git/objects/fb/b246ea231aea7d2e47a275a787f368740c0d35 differ diff --git a/.old.git/objects/pack/pack-3a977e81732cae643e34b798dad95a701f9a3822.idx b/.old.git/objects/pack/pack-3a977e81732cae643e34b798dad95a701f9a3822.idx new file mode 100644 index 0000000..9fc2545 Binary files /dev/null and b/.old.git/objects/pack/pack-3a977e81732cae643e34b798dad95a701f9a3822.idx differ diff --git a/.old.git/objects/pack/pack-3a977e81732cae643e34b798dad95a701f9a3822.pack b/.old.git/objects/pack/pack-3a977e81732cae643e34b798dad95a701f9a3822.pack new file mode 100644 index 0000000..eafb933 Binary files /dev/null and b/.old.git/objects/pack/pack-3a977e81732cae643e34b798dad95a701f9a3822.pack differ diff --git a/.old.git/packed-refs b/.old.git/packed-refs new file mode 100644 index 0000000..250f187 --- /dev/null +++ b/.old.git/packed-refs @@ -0,0 +1 @@ +# pack-refs with: peeled fully-peeled sorted diff --git a/.old.git/refs/heads/0001/add-go-webserver b/.old.git/refs/heads/0001/add-go-webserver new file mode 100644 index 0000000..dbb4f92 --- /dev/null +++ b/.old.git/refs/heads/0001/add-go-webserver @@ -0,0 +1 @@ +be723bf91dbc13af52d7f73b5f15467cef0c7f1b diff --git a/.old.git/refs/heads/2-create-a-simple-go-webserver b/.old.git/refs/heads/2-create-a-simple-go-webserver new file mode 100644 index 0000000..9264574 --- /dev/null +++ b/.old.git/refs/heads/2-create-a-simple-go-webserver @@ -0,0 +1 @@ +2994726718040e9b7d1f95b5957ada28d5b03b8e diff --git a/.old.git/refs/heads/3-containerize-service b/.old.git/refs/heads/3-containerize-service new file mode 100644 index 0000000..3bd8865 --- /dev/null +++ b/.old.git/refs/heads/3-containerize-service @@ -0,0 +1 @@ +832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 diff --git a/.old.git/refs/heads/3-create-docker-image b/.old.git/refs/heads/3-create-docker-image new file mode 100644 index 0000000..19c1014 --- /dev/null +++ b/.old.git/refs/heads/3-create-docker-image @@ -0,0 +1 @@ +fa5b934ed6c6536c8f63dd2463d77a9c15218d9c diff --git a/.old.git/refs/heads/4-document-go-application b/.old.git/refs/heads/4-document-go-application new file mode 100644 index 0000000..68539d8 --- /dev/null +++ b/.old.git/refs/heads/4-document-go-application @@ -0,0 +1 @@ +b6a801720d7653823d15c1d53e5dd2d96613030d diff --git a/.old.git/refs/heads/5-implement-ci-pipeline b/.old.git/refs/heads/5-implement-ci-pipeline new file mode 100644 index 0000000..38a1e05 --- /dev/null +++ b/.old.git/refs/heads/5-implement-ci-pipeline @@ -0,0 +1 @@ +4e45344d9401565cf82acb82932ccb11635a2b48 diff --git a/.old.git/refs/heads/6-create-a-helm-chart-for-deployment b/.old.git/refs/heads/6-create-a-helm-chart-for-deployment new file mode 100644 index 0000000..6d40db7 --- /dev/null +++ b/.old.git/refs/heads/6-create-a-helm-chart-for-deployment @@ -0,0 +1 @@ +1f83c1106dcd22a7e34bd38e57933d06b87c7968 diff --git a/.old.git/refs/heads/fix/ci b/.old.git/refs/heads/fix/ci new file mode 100644 index 0000000..594e582 --- /dev/null +++ b/.old.git/refs/heads/fix/ci @@ -0,0 +1 @@ +4077c05cfb9fe153e27aedacdb61a7761fa12920 diff --git a/.old.git/refs/heads/main b/.old.git/refs/heads/main new file mode 100644 index 0000000..c126849 --- /dev/null +++ b/.old.git/refs/heads/main @@ -0,0 +1 @@ +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 diff --git a/.old.git/refs/remotes/gitlab/0001/add-go-webserver b/.old.git/refs/remotes/gitlab/0001/add-go-webserver new file mode 100644 index 0000000..dbb4f92 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/0001/add-go-webserver @@ -0,0 +1 @@ +be723bf91dbc13af52d7f73b5f15467cef0c7f1b diff --git a/.old.git/refs/remotes/gitlab/2-create-a-simple-go-webserver b/.old.git/refs/remotes/gitlab/2-create-a-simple-go-webserver new file mode 100644 index 0000000..9264574 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/2-create-a-simple-go-webserver @@ -0,0 +1 @@ +2994726718040e9b7d1f95b5957ada28d5b03b8e diff --git a/.old.git/refs/remotes/gitlab/3-containerize-service b/.old.git/refs/remotes/gitlab/3-containerize-service new file mode 100644 index 0000000..3bd8865 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/3-containerize-service @@ -0,0 +1 @@ +832faa86c172a2ef1d7f78bdfa1e4f0ce0340d08 diff --git a/.old.git/refs/remotes/gitlab/3-create-docker-image b/.old.git/refs/remotes/gitlab/3-create-docker-image new file mode 100644 index 0000000..19c1014 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/3-create-docker-image @@ -0,0 +1 @@ +fa5b934ed6c6536c8f63dd2463d77a9c15218d9c diff --git a/.old.git/refs/remotes/gitlab/4-document-go-application b/.old.git/refs/remotes/gitlab/4-document-go-application new file mode 100644 index 0000000..68539d8 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/4-document-go-application @@ -0,0 +1 @@ +b6a801720d7653823d15c1d53e5dd2d96613030d diff --git a/.old.git/refs/remotes/gitlab/5-implement-ci-pipeline b/.old.git/refs/remotes/gitlab/5-implement-ci-pipeline new file mode 100644 index 0000000..38a1e05 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/5-implement-ci-pipeline @@ -0,0 +1 @@ +4e45344d9401565cf82acb82932ccb11635a2b48 diff --git a/.old.git/refs/remotes/gitlab/6-create-a-helm-chart-for-deployment b/.old.git/refs/remotes/gitlab/6-create-a-helm-chart-for-deployment new file mode 100644 index 0000000..6d40db7 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/6-create-a-helm-chart-for-deployment @@ -0,0 +1 @@ +1f83c1106dcd22a7e34bd38e57933d06b87c7968 diff --git a/.old.git/refs/remotes/gitlab/HEAD b/.old.git/refs/remotes/gitlab/HEAD new file mode 100644 index 0000000..caf96e6 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/gitlab/main diff --git a/.old.git/refs/remotes/gitlab/fix/ci b/.old.git/refs/remotes/gitlab/fix/ci new file mode 100644 index 0000000..594e582 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/fix/ci @@ -0,0 +1 @@ +4077c05cfb9fe153e27aedacdb61a7761fa12920 diff --git a/.old.git/refs/remotes/gitlab/main b/.old.git/refs/remotes/gitlab/main new file mode 100644 index 0000000..c126849 --- /dev/null +++ b/.old.git/refs/remotes/gitlab/main @@ -0,0 +1 @@ +14cb4b4eb0aca0d3fddd98f1f17df626fbd05941 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..693121f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,45 @@ +# Build stage +FROM golang:1.23.12-alpine AS builder + +WORKDIR /build + +COPY go.mod ./ +COPY main.go . + +# CGO_ENABLED=0 for static binary +# -ldflags for smaller binary size +# GOOS=linux for OS compatibility +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w -s' -o interview-server ./main.go + +# Run stage +FROM debian:bullseye-slim + +# Install ca-certificates for HTTPS +RUN apt-get update && \ + apt-get install -y --no-install-recommends ca-certificates && \ + rm -rf /var/lib/apt/lists/* + +# Create non-root user for security +RUN useradd -u 1000 -m appuser + +# Change directory for runtime +WORKDIR /app + +# Copy the binary from builder +COPY --from=builder /build/interview-server . + +# Copy entrypoint script +COPY docker-entrypoint.sh . +RUN chmod +x docker-entrypoint.sh + +# Ensure non-root user is running the applicatoin +USER appuser + +# Expose on default port +EXPOSE 8080 + +# Path to config file can be set via ENV variable +ENV CONFIG_FILE="" + +# Run the application using JSON form for proper signal handling +ENTRYPOINT ["./docker-entrypoint.sh"] \ No newline at end of file diff --git a/INSTRUCTIONS.md b/INSTRUCTIONS.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..4e56ba9 --- /dev/null +++ b/README.md @@ -0,0 +1,117 @@ +# gl-operate-go-k8s + +Go HTTP server for a Gitlab Interview + +## Requirements + +- Go 1.23+ +- Docker (optional) +- Helm 4.0+ (optional) + +## Quick Start + +Build and run: + +```bash +go build -o interview-server . +./interview-server +``` + +Server starts on `http://localhost:8080` + +## Configuration + +You can configure the server using environment variables or a JSON config file. Environment variables take precedence. + +**Environment variables:** + +- `SERVER_PORT` - Port to listen on (default: 8080) +- `SERVER_HOST` - Host to bind to (default: 0.0.0.0) +- `SERVER_ROOT_PATH` - Directory to serve files from (default: current directory) +- `SERVER_AUTH_SECRET` - Bearer token for API authentication +- `CONFIG_FILE` - Path to config file + +**Example:** + +```bash +export SERVER_PORT=3000 +export SERVER_ROOT_PATH=/var/www +export SERVER_AUTH_SECRET=my-secret-token +./interview-server +``` + +**Config file:** + +```bash +./interview-server -config config.json +``` + +The config file is JSON: + +```json +{ + "port": 8080, + "host": "0.0.0.0", + "root_path": "/app/data", + "auth_secret": "your-secret-token" +} +``` + +## Docker + +Build: + +```bash +docker build -t interview-service:latest . +``` + +Run: + +```bash +docker run -p 8080:8080 -e SERVER_AUTH_SECRET=mysecret interview-service:latest +``` + +## Kubernetes + +Install with Helm: + +```bash +helm install interview-server ./helm +``` + +Port forward to access locally: + +```bash +kubectl port-forward svc/interview-server-interview-server 8080:8080 +``` + +## Testing + +```bash +go test -v +``` + +## How it works + +The server has two main parts: + +- `/` - Serves static files from the configured root path +- `/api/*` - Protected endpoint that requires authentication + +For `/api/*` routes, you need to send a Bearer token that matches `SERVER_AUTH_SECRET`: + +```bash +curl -H "Authorization: Bearer my-secret-token" http://localhost:8080/api/test +``` + +Logs are JSON formatted and go to stdout. The app handles SIGTERM/SIGINT for graceful shutdown. + +## Deployment notes + +The application is stateless and can be scaled horizontally. It runs as a non-root user (UID 1000) in the container. + +Resource usage is minimal - 50m CPU and 64Mi memory is enough for most workloads. Recommended limits are 100m CPU and 128Mi memory. + +The server doesn't do TLS, so you'll want a reverse proxy or ingress controller in production for HTTPS. + +Store `SERVER_AUTH_SECRET` in Kubernetes Secrets, not in plain text config. diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..cb7cb51 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +# Build command arguments +if [ -n "$CONFIG_FILE" ]; then + exec ./interview-server -config "$CONFIG_FILE" +else + exec ./interview-server +fi diff --git a/example.config.json b/example.config.json new file mode 100644 index 0000000..7ac0077 --- /dev/null +++ b/example.config.json @@ -0,0 +1,6 @@ +{ + "port": 8080, + "host": "0.0.0.0", + "root_path": "./public", + "auth_secret": "secret-token" +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f3acea0 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module interview-server + +go 1.23.0 + +toolchain go1.24.11 diff --git a/helm/.helmignore b/helm/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/helm/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 0000000..0b9d31b --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: interview-server +description: Helm chart for Go server +type: application +version: 0.1.0 +appVersion: "1.0.0" diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txt new file mode 100644 index 0000000..2c05e0b --- /dev/null +++ b/helm/templates/NOTES.txt @@ -0,0 +1,7 @@ +Successfully deployed {{ .Chart.Name }}! + +To access your application: + + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "interview-server.fullname" . }} 8080:{{ .Values.service.port }} + +Then visit: http://localhost:8080 diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl new file mode 100644 index 0000000..02f0021 --- /dev/null +++ b/helm/templates/_helpers.tpl @@ -0,0 +1,38 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "interview-server.name" -}} +{{- .Chart.Name | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +*/}} +{{- define "interview-server.fullname" -}} +{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "interview-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "interview-server.labels" -}} +helm.sh/chart: {{ include "interview-server.chart" . }} +{{ include "interview-server.selectorLabels" . }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "interview-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "interview-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml new file mode 100644 index 0000000..e63ff2a --- /dev/null +++ b/helm/templates/deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "interview-server.fullname" . }} + labels: + {{- include "interview-server.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "interview-server.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "interview-server.labels" . | nindent 8 }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.env }} + env: + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml new file mode 100644 index 0000000..7a26bbd --- /dev/null +++ b/helm/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "interview-server.fullname" . }} + labels: + {{- include "interview-server.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "interview-server.selectorLabels" . | nindent 4 }} diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 0000000..f607d52 --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1,25 @@ +replicaCount: 1 + +image: + repository: docker.io/uhryniuk/go-server + pullPolicy: IfNotPresent + tag: "latest" + +service: + type: ClusterIP + port: 8080 + +env: + SERVER_PORT: "8080" + SERVER_HOST: "0.0.0.0" + SERVER_ROOT_PATH: "/app" + SERVER_AUTH_SECRET: "some-secret" + CONFIG_FILE: "" + +resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 50m + memory: 64Mi diff --git a/main.go b/main.go new file mode 100644 index 0000000..1a497d3 --- /dev/null +++ b/main.go @@ -0,0 +1,197 @@ +package main + +import ( + "encoding/json" + "flag" + "fmt" + "log/slog" + "net/http" + "os" + "strconv" + "strings" +) + +// Config represents the HTTP server configuration +type Config struct { + Port int `json:"port"` + Host string `json:"host"` + RootPath string `json:"root_path"` + AuthSecret string `json:"auth_secret"` +} + +// Server containers contextual dependencies for the HTTP server +type Server struct { + config *Config + logger *slog.Logger + mux *http.ServeMux +} + +// NewServer creates a new instance with the provided configuration +func NewServer(config *Config, logger *slog.Logger) *Server { + return &Server{ + config: config, + logger: logger, + mux: http.NewServeMux(), + } +} + +// SetupRoutes configures routes on the Server +func (s *Server) SetupRoutes() { + // Public file server + fs := http.FileServer(http.Dir(s.config.RootPath)) + s.mux.Handle("/", fs) + + // Protected API endpoint + s.mux.Handle("/api/", s.authMiddleware(http.HandlerFunc(s.apiHandler))) +} + +// Start logs and starts the underlying HTTP server +func (s *Server) Start() error { + addr := fmt.Sprintf("%s:%d", s.config.Host, s.config.Port) + s.logger.Info("starting HTTP server", "address", addr) + return http.ListenAndServe(addr, s.mux) +} + +func main() { + // setup structured logger + jsonHandler := slog.NewJSONHandler(os.Stdout, nil) + log := slog.New(jsonHandler) + + // create and parse cli args for config file + var configFile string + flag.StringVar(&configFile, "config", "", "Configuration file for HTTP server.") + flag.Parse() + log.Debug("parsed command line flags") + + // load configuration + loader := &ConfigLoader{ + readFile: os.ReadFile, + getEnv: os.Getenv, + } + config, err := loader.Load(configFile) + if err != nil { + log.Error("failed to load configuration", "error", err) + os.Exit(1) + } + + log.Info("server configuration loaded", + "host", config.Host, + "port", config.Port, + "root_path", config.RootPath, + "auth_enabled", config.AuthSecret != "") + + // create and start server + server := NewServer(config, log) + server.SetupRoutes() + + if err := server.Start(); err != nil { + log.Error("server failed", "error", err) + os.Exit(1) + } +} + +// ConfigLoader simplifies loading configuration from file and environment variables +type ConfigLoader struct { + readFile func(string) ([]byte, error) + getEnv func(string) string +} + +// Load conditionally loads variables from the file and env +func (cl *ConfigLoader) Load(configFile string) (*Config, error) { + config := &Config{ + Port: 8080, // default port + Host: "0.0.0.0", // default host + RootPath: ".", // default root path + } + + if configFile != "" { + if err := cl.loadFromFile(configFile, config); err != nil { + return nil, fmt.Errorf("failed to load config from file: %w", err) + } + } + + if err := cl.loadFromEnv(config); err != nil { + return nil, err + } + + return config, nil +} + +// loadFromFile reads and unmarshals the configuration +func (cl *ConfigLoader) loadFromFile(filename string, config *Config) error { + data, err := cl.readFile(filename) + if err != nil { + return err + } + + return json.Unmarshal(data, config) +} + +// loadFromEnv loads configuration from environment variables +func (cl *ConfigLoader) loadFromEnv(config *Config) error { + if port := cl.getEnv("SERVER_PORT"); port != "" { + p, err := strconv.Atoi(port) + if err != nil { + return fmt.Errorf("invalid SERVER_PORT: %w", err) + } + config.Port = p + } + + if host := cl.getEnv("SERVER_HOST"); host != "" { + config.Host = host + } + + if rootPath := cl.getEnv("SERVER_ROOT_PATH"); rootPath != "" { + config.RootPath = rootPath + } + + if authSecret := cl.getEnv("SERVER_AUTH_SECRET"); authSecret != "" { + config.AuthSecret = authSecret + } + + return nil +} + +// validateToken checks if the provided token matches the secret +func validateToken(authHeader, secret string) bool { + if !strings.HasPrefix(authHeader, "Bearer ") { + return false + } + token := strings.TrimPrefix(authHeader, "Bearer ") + return token == secret +} + +// authMiddleware validates authentication using Bearer token +func (s *Server) authMiddleware(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Skip authentication if no secret is configured + if s.config.AuthSecret == "" { + s.logger.Warn("authentication bypassed - no secret configured") + next.ServeHTTP(w, r) + return + } + + // Validate token and respond accordingly + authHeader := r.Header.Get("Authorization") + if validateToken(authHeader, s.config.AuthSecret) { + s.logger.Info("authentication successful", "path", r.URL.Path) + next.ServeHTTP(w, r) + return + } + + // Fallback on authentication failure + s.logger.Warn("authentication failed", "path", r.URL.Path, "remote_addr", r.RemoteAddr) + w.Header().Set("WWW-Authenticate", `Bearer realm="Restricted"`) + http.Error(w, "Unauthorized", http.StatusUnauthorized) + }) +} + +// apiHandler handles authenticated API requests +func (s *Server) apiHandler(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(map[string]interface{}{ + "message": "authenticated request successful", + "path": r.URL.Path, + "method": r.Method, + }) +} diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..b87bb0e --- /dev/null +++ b/main_test.go @@ -0,0 +1,98 @@ +package main + +import ( + "io" + "log/slog" + "net/http" + "net/http/httptest" + "testing" +) + +// TestValidateToken ensures the token validation logic works as expected. +func TestValidateToken(t *testing.T) { + tests := []struct { + authHeader string + secret string + want bool + }{ + {"Bearer mysecret", "mysecret", true}, + {"Bearer wrong", "mysecret", false}, + {"mysecret", "mysecret", false}, + {"", "mysecret", false}, + } + + for _, tt := range tests { + if got := validateToken(tt.authHeader, tt.secret); got != tt.want { + t.Errorf("validateToken(%q, %q) = %v, want %v", tt.authHeader, tt.secret, got, tt.want) + } + } +} + +// TestConfigLoader_Load tests loading configuration from file and environment variables. +func TestConfigLoader_Load(t *testing.T) { + tests := []struct { + name string + file string + fileData string + envVars map[string]string + wantPort int + wantErr bool + }{ + {"defaults", "", "", map[string]string{}, 8080, false}, + {"from file", "cfg.json", `{"port":3000}`, map[string]string{}, 3000, false}, + {"env override", "cfg.json", `{"port":3000}`, map[string]string{"SERVER_PORT": "9000"}, 9000, false}, + {"invalid port", "", "", map[string]string{"SERVER_PORT": "bad"}, 0, true}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + loader := &ConfigLoader{ + readFile: func(string) ([]byte, error) { return []byte(tt.fileData), nil }, + getEnv: func(key string) string { return tt.envVars[key] }, + } + + cfg, err := loader.Load(tt.file) + if (err != nil) != tt.wantErr { + t.Fatalf("Load() error = %v, wantErr %v", err, tt.wantErr) + } + if !tt.wantErr && cfg.Port != tt.wantPort { + t.Errorf("Port = %v, want %v", cfg.Port, tt.wantPort) + } + }) + } +} + +// TestServer_authMiddleware ensures authentication middleware enforces token validation correctly. +func TestServer_authMiddleware(t *testing.T) { + tests := []struct { + name string + secret string + authHeader string + wantStatus int + }{ + {"valid token", "secret", "Bearer secret", http.StatusOK}, + {"invalid token", "secret", "Bearer wrong", http.StatusUnauthorized}, + {"no secret", "", "", http.StatusOK}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + server := NewServer(&Config{AuthSecret: tt.secret}, slog.New(slog.NewTextHandler(io.Discard, nil))) + handler := server.authMiddleware(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + })) + + req := httptest.NewRequest(http.MethodGet, "/api/test", nil) + if tt.authHeader != "" { + req.Header.Set("Authorization", tt.authHeader) + } + + rr := httptest.NewRecorder() + handler.ServeHTTP(rr, req) + + if rr.Code != tt.wantStatus { + t.Errorf("status = %v, want %v", rr.Code, tt.wantStatus) + } + }) + } +}