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

revert golang-http and keep golang-middleware #81

Closed
wants to merge 1 commit into from
Closed

revert golang-http and keep golang-middleware #81

wants to merge 1 commit into from

Conversation

mrwormhole
Copy link
Contributor

@mrwormhole mrwormhole commented Aug 27, 2022

Description

Keeping golang-http same as @LucasRoesler 's suggestion and reverting workspaces but keeping workspaces for golang-middlewares

How Has This Been Tested?

 git clone https://github.com/LucasRoesler/golang-http-template-examples
 cd golang-http-template-examples
 rm go.work
 faas-cli template pull https://github.com/MrWormHole/golang-http-template
 faas-cli build

How are existing users impacted? What migration steps/scripts do we need?

examples no longer download dependencies from the internet after go mod vendor 👍

also added build base due to CGO_ENABLED=1 causing build failure
https://pkgs.alpinelinux.org/package/v3.3/main/x86/build-base

if this PR is accepted, it closes #74 @LucasRoesler @alexellis

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • read the CONTRIBUTION guide
  • signed-off my commits with git commit -s
  • added unit tests

@derek derek bot added the no-dco label Aug 27, 2022
@derek
Copy link

derek bot commented Aug 27, 2022

Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.

Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.

💡 Shall we fix this?

This will only take a few moments.

First, clone your fork and checkout this branch using the git CLI.

Next, set up your real name and email address:

git config --global user.name "Your Full Name"
git config --global user.email "you@domain.com"

Finally, run one of these commands to add the "Signed-off-by" line to your commits.

If you only have one commit so far then run: git commit --amend --signoff and then git push --force.
If you have multiple commits, watch this video.

Check that the message has been added properly by running "git log".

@derek derek bot added no-dco and removed no-dco labels Aug 27, 2022
@derek
Copy link

derek bot commented Aug 27, 2022

Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.

Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.

💡 Shall we fix this?

This will only take a few moments.

First, clone your fork and checkout this branch using the git CLI.

Next, set up your real name and email address:

git config --global user.name "Your Full Name"
git config --global user.email "you@domain.com"

Finally, run one of these commands to add the "Signed-off-by" line to your commits.

If you only have one commit so far then run: git commit --amend --signoff and then git push --force.
If you have multiple commits, watch this video.

Check that the message has been added properly by running "git log".

@@ -2,4 +2,9 @@ module handler

go 1.18

require github.com/openfaas/templates-sdk/go-http v0.0.0-20220408082716-5981c545cb03
Copy link
Contributor Author

@mrwormhole mrwormhole Aug 27, 2022

Choose a reason for hiding this comment

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

this part is copied from this repository times

https://github.com/openfaas/golang-http-template/tree/eb793ff6f2749e1ebb02f4c235a78d7602102d7e

happy to discuss this, if giving path makes download faster

@derek derek bot removed the no-dco label Aug 27, 2022
@@ -32,7 +32,7 @@ RUN mkdir -p /go/src/handler/function/static
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test ./... -cover

WORKDIR /go/src/handler
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed CGO_ENABLED from here for consistency with other dockerfiles

@@ -6,12 +6,11 @@ ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

RUN apk --no-cache add git
RUN apk --no-cache add build-base
Copy link
Contributor Author

Choose a reason for hiding this comment

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

CGO_ENABLED = 1 doesn't build, added build-base

@derek derek bot added the no-dco label Aug 27, 2022
@derek
Copy link

derek bot commented Aug 27, 2022

Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.

Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.

💡 Shall we fix this?

This will only take a few moments.

First, clone your fork and checkout this branch using the git CLI.

Next, set up your real name and email address:

git config --global user.name "Your Full Name"
git config --global user.email "you@domain.com"

Finally, run one of these commands to add the "Signed-off-by" line to your commits.

If you only have one commit so far then run: git commit --amend --signoff and then git push --force.
If you have multiple commits, watch this video.

Check that the message has been added properly by running "git log".

@derek derek bot removed the no-dco label Aug 27, 2022
Signed-off-by: F. Talha Altinel <talhaaltinel@hotmail.com>

ensure up-to-date alpine images

make no changes on go.work

tidy go.mod

put static dirs back in Dockerfile

fallback to old cleanup_vendor_modulestxt shell script

add build-base for CGO

tidy up

add git back

Signed-off-by: F. Talha Altinel <talhaaltinel@hotmail.com>
replace handler/function => ./function

require (
github.com/openfaas/templates-sdk v0.0.0-20200723092016-0ebf61253625
Copy link
Member

Choose a reason for hiding this comment

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

i think we want to use the current sha here instead of reverting this value, this keeps the template-sdk up-to-date

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea makes perfect sense, only thing I was not sure about is the difference between 2020 and 2022 in this repository in terms of reliability. Will do the change

@mrwormhole
Copy link
Contributor Author

can be closed, no longer required, golang-http will be using the interface for the golang-HTTP template. build-base is no longer required due to https://docs.openfaas.com/cli/build/#10-apply-build-options

@mrwormhole mrwormhole closed this Aug 31, 2022
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