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

Separate generate swagger + fix sed os specific #1791

Merged
merged 5 commits into from
Jun 15, 2017

Conversation

sapk
Copy link
Member

@sapk sapk commented May 24, 2017

I suggest to remove generation of swagger file via go generate and make a separate make task.

Making it in go generate permit that any change in comments would update the docs but it add some overhead and seems to failed on CI build (maybe from change introduce in go-swagger ?). :-(

With this change, people redacting api docs would have to do make generate-swagger to rebuild the swagger.json file.

Related to : #1785 #1665

@sapk
Copy link
Member Author

sapk commented May 24, 2017

For the build failing it seems that it's #1766 that change a func names and so any PR not rebased over that will failed (so not swagger). We can still separate swagger from go generate for overhead.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 24, 2017
@lunny lunny added this to the 1.2.0 milestone May 25, 2017
@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label May 25, 2017
Makefile Outdated
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u github.com/go-swagger/go-swagger/cmd/swagger; \
fi
go generate $(PACKAGES)
swagger generate spec -o ./public/swagger.v1.json
sed -i "s;\".ref\": \"#/definitions/GPGKey\";\"type\": \"object\";g" ./public/swagger.v1.json
Copy link
Member

Choose a reason for hiding this comment

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

We need to support sed command for MacOS version.

See https://github.com/appleboy/golang-testing/blob/master/coverage.sh#L130-L131

sapk added 5 commits June 15, 2017 11:42
for compatibility with mac os default sed version.
This is a little hacky a better solution could be use.
depending of platform detection
@sapk sapk force-pushed the separate-generate-swagger branch from 4b65a21 to d1b6739 Compare June 15, 2017 09:46
@sapk sapk changed the title [WIP/not tested yet] Separate generate swagger Separate generate swagger + fix sed os variant Jun 15, 2017
@sapk sapk changed the title Separate generate swagger + fix sed os variant Separate generate swagger + fix sed os specific Jun 15, 2017
@sapk
Copy link
Member Author

sapk commented Jun 15, 2017

Ok this was rebase and ready to ship.

@lunny can you confirm that this sed command works on mac os ?

@lunny
Copy link
Member

lunny commented Jun 15, 2017

I confirmed that this fixed #1665 on macOS. LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 15, 2017
Copy link
Member

@appleboy appleboy left a comment

Choose a reason for hiding this comment

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

Great work. I can confirm this PR working in Mac.

@appleboy
Copy link
Member

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 15, 2017
@appleboy appleboy merged commit 2bcd947 into go-gitea:master Jun 15, 2017
@sapk sapk deleted the separate-generate-swagger branch June 17, 2017 17:13
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants