Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added support for Harry Potter category, Sprint Name Generator Docker image, div improvements #38

Merged
merged 15 commits into from
Jul 12, 2022

Conversation

guidemetothemoon
Copy link
Contributor

@guidemetothemoon guidemetothemoon commented Jun 28, 2022

Hello @flostadler @wederer !
I have added a few enhancements to Sprint Name Generator, I hope you don't mind☺️
I would really appreciate a review. You can also check my forked repo and respective repo on Docker Hub with latest working Sprint Name Generator container image: https://github.com/guidemetothemoon/sprint-name-generator

Following changes have been made:

  • Housekeeping: updated outdated package and dependency versions (Go, Node.js, npm);
  • Updated Dockerfile to build a fully working Sprint Name Generator application as a container;
  • Added support to build and push container image to Docker Hub as part of CI/CD;
  • Added LICENSE.md with MIT license for Sprint Name Generator;
  • Updated README.md with information on how to build and run container image locally and how to download and run latest container image from Docker Hub (currently linking my repo on Docker Hub in addition to the original);
  • Added new category to Sprint Name Generator: Harry Potter! 🧙
    The final result will look like this:

image

Important note: a few updates are needed from your side as repo owners to get it working.

  • Source build in original repo has been failing for a while now on deployment stage and it looks like it's related to the expired public key. I can't update that so I hope that you can take a look at it? https://github.com/flostadler/sprint-name-generator/runs/6091946451?check_suite_focus=true
  • I have added actions to the workflow to build and push Sprint Generator Name container image to Docker Hub. We need to create 2 secrets for GitHub Actions in this repo that are referenced by GitHub Actions:
  1. DOCKER_HUB_USERNAME -> username of the one owning the Sprint Name Generator repo on Docker Hub, I assume it should be flostadler ?
  2. DOCKER_HUB_ACCESS_TOKEN -> access token that gives permissions for the build pipeline to access Sprint Name Generator repo on Docker Hub (to push and pull images).

Linked issues:
#8
#6

@wederer
Copy link
Collaborator

wederer commented Jun 28, 2022

Hey @guidemetothemoon,

wow, thanks for the big PR! 😮
I am currently a bit swamped with work, but will hopefully be able to take a look in the coming week! ✌️

@flostadler
Copy link
Owner

Thanks a lot for the PR @guidemetothemoon!

I'll try to review it as soon as possible :)

@flostadler
Copy link
Owner

Sorry for the delay - busy week. I have a long train ride coming up today and will use it to review it :)

Copy link
Collaborator

@wederer wederer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frontend changes look good to me. Thanks again!

Copy link
Owner

@flostadler flostadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small comments regarding the docker image

Comment on lines 10 to 15
RUN go install github.com/shurcooL/goexec@latest
RUN go get github.com/shurcooL/go-goon

EXPOSE 80

CMD ["goexec", "http.ListenAndServe(`:80`, http.FileServer(http.Dir(`.`)))"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for adding goexec and go-goon?
go-goon is deprecated afaik.

Why can't we just have the mux http APIs as part of a regular go executable?

Or is this for starting a web server to serve the web site locally?
If it's for local development I'd say we should try and keep both the APIs and the local development setup.

I think for the local development using nginx as the container image might be easiest

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flostadler thanks for the review! I'm pretty new at Go development so in this case I've followed one of the recommended approaches on containerizing Go+WASM application. Guidelines might not have been 100% up-to-date though since you mentioned that go-goon is deprecated.
Now, I'm not quite sure why you need to build a container to only have APIs? I thought that the purpose of introducing a container in this case is to be able to run and host this application wherever you want instead of using publicly available version for instance... Therefore I updated Dockerfile with a thought to make it possible to run Sprint Name Generator application as a whole, in a container. I tried to make the original container work but I didn't manage it, maybe due to the fact that I didn't have the whole picture on why you would want to only make the APIs available in a container and which APIs would that be?

I can update the Dockerfile by removing the outdated components so that an application could be run as a container but should the API version also be available you think?

Also, please check PR description - I think that you will need to make a few adjustments to make the build work once all changes in this PR are OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flostadler , today I digged more into how Golang and WASM hang together and of course it's perfectly simple and straightforward to use NGINX as a web server in this case! Thanks a lot for challenging me on this, learned a lot of valuable stuff today! 😸 I've now tested and updated the Dockerfile to support running Sprint Name Generator in a container. Please let me know if anything else needs to be updated.

Copy link
Owner

@flostadler flostadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks again for adding all of those cool new changes! Much appreciated :)

@flostadler flostadler merged commit 60c28b7 into flostadler:master Jul 12, 2022
@guidemetothemoon
Copy link
Contributor Author

@flostadler awesome, I'm glad to help out! Just a gentle reminder in case you missed it in my previous comment: you will need to add Docker username and access token to GitHub repo secrets and fix the access token to deploy to GitHub Pages so that build goes through successfully (it fails now). More info is added to the PR description.
I don't have permissions to do that unfortunately. Just let me know if I can help in any way!🤗

@flostadler
Copy link
Owner

Yeah I already took note about that and will do it once I'm done with work for today :) If I have some questions I'll add them here, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants