GithubHelp home page GithubHelp logo

servian / techchallengeapp Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 194.0 3.44 MB

Application for the Servian Tech Test

Home Page: http://www.servian.com/devops

License: MIT License

CSS 2.70% JavaScript 7.68% Shell 0.67% Go 86.26% Dockerfile 2.69%

techchallengeapp's People

Contributors

andrewpym-servian avatar carljavier avatar chrisfowles avatar jamielennox avatar thomas-winsnes-vibrato avatar tristanmorgan avatar ttangsv avatar twinsnes avatar wadefrancis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

techchallengeapp's Issues

dep is used for dependency management in golang [official link] for windows is broken

Windows dependency management link is broken

as we click on the [official link] it will direct us to
https://github.com/golang/dep which is working but see the below [go.equinox.io] is broken

On Windows, you can download a tarball from go.equinox.io.

Windows 10

  • version of application >>v.0.7.0
  • version of golang >>go1.15.8
  • version of postgres>>Not installed yet

Steps to reproduce

as we click on the [official link] it will direct us to
https://github.com/golang/dep which is working but see the below [go.equinox.io] is broken

On Windows, you can download a tarball from go.equinox.io.

the link should be updated or for windows where the end-user can download the package

Tell us what should happen

End-user can download the dependency package so not able to build on windows

Tell us what happens instead

Unable to Build Docker Image using provided Dockerfile with Go 1.16

Unable to Build Docker Image using provided Dockerfile with Go 1.16

On 16th Feb 2021, a new version of GO 1.16 was released which defaults to "Module-aware mode" i.e. Environment Variable GO111MODULE defaults to "on". To build a docker image for the TechChallengeApp we need to explicitly set this variable to "auto" in the docker file.

Reference: https://golang.org/doc/go1.16#go-command

Environment Details

  • version of application=0.8.0
  • version of golang=1.16
  • version of postgres=10.7

Steps to reproduce

On Linux: Run command docker build -f Dockerfile .

Expected behaviour

A successful build of the docker image

Actual behaviour

Failure to build the docker image

Attached are the Successful logs using GO 1.15 and Failed logs using GO 1.16
DockerImageBuildLogs.zip

Swagger Library Dependencies in Docker FIle

Subject of the issue

Docker File:
Describe your issue here.
Current Dockerfile where swagger dependencies are downloaded has issues

Your environment

  • version of application
  • version of golang
  • version of postgres

Steps to reproduce

Tell us how to reproduce this issue

Expected behaviour

Tell us what should happen: It should download all the swagger dependencies

Actual behaviour

Tell us what happens instead; Attaching the correct docker file to download the dependencies
dockerfile.txt

Postgres user permissions

Subject of the issue

AWS RDS using Postgres 10.4 permissions issue.

pq: permission denied for tablespace pg_default

Your environment

  • Application v0.3.6
  • Golang go1.9.4 linux/amd64
  • Postgres 10.4

Steps to reproduce

Adding the app files to an EC2 instance to communicate with the Postgres 10.4 RDS database and running ./TechTestAppLinux updatedb -s

Expected behaviour

Dropping and recreating table: tasks
DROP TABLE IF EXISTS tasks CASCADE
CREATE TABLE tasks ( id SERIAL PRIMARY KEY, completed boolean NOT NULL, priority integer NOT NULL, title text NOT NULL)
Seeding table with data

Actual behaviour

Dropping and recreating database: <dbname>
DROP DATABASE IF EXISTS <dbname>
CREATE DATABASE <dbname>
WITH 
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'en_US.utf8'
LC_CTYPE = 'en_US.utf8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1
TEMPLATE template0;
pq: permission denied for tablespace pg_default

Workaround

Use Postgres 9.6 for the RDS to solve this issue.

Unable to create seed test data | Azure pgsql not liking username without @

Subject of the issue

I am unable to create seed test database in my Azure PostgreSQL server. An error is thrown by CREATE DATABASE query in updatedb.go when the owner has the format username@hostname. This format is expected from the pgsql server to be able to connect to it.

Your environment

servian/TechChallengeApp

Steps to reproduce

  • Create Azure Postgresql server
  • Update conf.toml with the server configuration
  • Create seed database using updatedb.go

Expected behaviour

I should be able to run below and create seed database in Azure Postgresql server.
./TechChallengeApp updatedb

Actual behaviour

If I pass DbUser without @, Azure PostgreSQL does not like it. The app is unable to connect to database server.
image

If I pass DbUser with @, updatedb.go does not like it. It fails at the CREATE DATABASE step,
image

image

Postgres 10 database create fails when collation is different

Subject of the issue

When running updatedb when the server collation is different than the default collation in the create scripts, it will fail.

Your environment

  • version of 0.3.4
  • version of 1.11
  • version of 10.4

Steps to reproduce

Run updatedb against a postgres db with a different collation than en_US.utf8

Expected behaviour

database should be updated

Actual behaviour

pq: new collation (en_US.utf8) is incompatible with the collation of the template database (en_US.UTF-8)

Feature: Pass environment config to the app as arguments at runtime

Feature Request

Would be nice to be able to pass environment variable arguments to the executable at runtime and/or for the app to read from local environment variables as a way to override what's specified in the the config.toml.

Justification

Adds flexibility to certain cloud hosting scenarios. E.g. Running the app daemon inside the HttpPlatformHandler bootstrap on Azure Web Apps generates a random HTTP_PLATFORM_PORT the app needs to listen on, which isn't known until the App Services provider assigns it one when instantiating a new instance.

Issue in Postgres connecting to Docker

Subject of the issue

Fail to Connect to Postgres from Docker 18.0 application
Describe your issue here.

Your environment

  • version of application
  • version of golang
  • version of postgres: 9.3 Above

Steps to reproduce

Tell us how to reproduce this issue:
If you are using Postgres 9.3 above with docker 18 the connection to DB Fails

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

SQL bugfix

Subject of the issue

Syntax error in database setup SQL

Your environment

  • version of application: v.0.3.5
  • version of golang: go version go1.11.2 darwin/amd64
  • version of postgres: psql (PostgreSQL) 11.1 (Debian 11.1-1.pgdg90+1)

Steps to reproduce

Build the executable from source and run "./TechTestApp updatedb" with valid database configuration

Expected behaviour

Database creation script should execute

Actual behaviour

Syntax error causes database creation script to fail

Environment Variable Input Cleaning

Subject of the issue

When an environment variable is passed or read by the config.go module, it doesn't clean environment variable input of whitespace. This can cause some errors in the app later where whitespace at the beginning or end of a value is unexpected.

Your environment

  • version of application: v0.3.3
  • version of golang: 1.10
  • version of postgres: N/A

Steps to reproduce

Set the environment variable VTT_LISTENPORT to "12345 " causes:

Error creating listener - listen tcp: lookup tcp/12345 : getaddrinfow: The specified class was not found.

Expected behaviour

If conf settings were cleaned of whitespace the error wouldn't occur.

Suggested improvement

Clean whitespace using the strings.TrimSpace() method, as per below:

import ( strings )

conf.DbUser     = strings.TrimSpace(v.GetString("DbUser"))
conf.DbPassword = strings.TrimSpace(v.GetString("DbPassword"))
conf.DbName     = strings.TrimSpace(v.GetString("DbName"))
conf.DbHost     = strings.TrimSpace(v.GetString("DbHost"))
conf.DbPort     = strings.TrimSpace(v.GetString("DbPort"))
conf.ListenHost = strings.TrimSpace(v.GetString("ListenHost"))
conf.ListenPort = strings.TrimSpace(v.GetString("ListenPort"))

Permission to servian/TechChallengeApp.git denied

Subject of the issue

Permission to servian/TechChallengeApp.git denied to sweet-aus.

Your environment

servian/TechChallengeApp

Describe in details

Found minor errors in 12 different files.
✖License
✖root.go
✖serve.go
✖updatedb.go
✖config.go
✖deamon.go
✖db.go
✖main.go
✖task.go
✖api.go
✖index.go
✖ui.go

Steps to reproduce

✅ Clone the repo
✅ Create a new branch
✅Go through the code
✅ Troubleshoot and update the code locally
✅ Push the code

Expected behaviour

Unable to push the code to the repository.

Actual behaviour

Permission to servian/TechChallengeApp.git denied

Let's arrange a meeting and discuss about this.

Docker container to postgres Azure DB(remote db) authentication error, issue db.go

Subject of the issue

docker container unable to authenticate to azure postgresql DB with provided variables.
Describe your issue here.
while docker container trying to connect to postgres db, db.go is expecting 'username@host' if we supply variable in in above mentioned format line 73 in db.go OWNER is expecting 'username' format, this will cause db creation will fail.
both values are supplied using same variable may causing issue.

Your environment

Azure posgresql rdb

  • version of application
    TechTestApp version 0.5.0
  • version of golang
  • version of postgres
    9.5

Steps to reproduce

reproducible
clone repo, build and run container
in azure env with postgresql db integration will fail
Tell us how to reproduce this issue

Expected behaviour

containered app should be able to provision azure postgresql database
Tell us what should happen

Actual behaviour

containered app not able to provision azure postgresql database
Tell us what happens instead

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.