-
Notifications
You must be signed in to change notification settings - Fork 132
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
Added the mattermost-webapp from the monorepo of mattermost #1074
base: master
Are you sure you want to change the base?
Changes from all commits
6318d9a
51971d8
b7f02c9
0db80af
ef5f4a0
d1d3325
afe03c9
d8dca10
1e72715
705c27f
5944661
b4273ae
3ebea55
f742355
cd00f67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,8 +176,8 @@ endif | |
# weird reports at golangci-lint step | ||
ifneq ($(HAS_SERVER),) | ||
@echo Running golangci-lint | ||
$(GO) vet ./... | ||
$(GOBIN)/golangci-lint run ./... | ||
$(GO) vet ./server/... ./build/... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this? Or will There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason I ask, is we want to keep the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mickmister Yeah we still require the file-hound package and its respective files. |
||
$(GOBIN)/golangci-lint run ./server/... ./build/... | ||
endif | ||
|
||
## Builds the server, if it exists, for all supported architectures, unless MM_SERVICESETTINGS_ENABLEDEVELOPER is set | ||
|
@@ -309,7 +309,7 @@ detach: setup-attach | |
.PHONY: test | ||
test: apply webapp/node_modules install-go-tools | ||
ifneq ($(HAS_SERVER),) | ||
$(GOBIN)/gotestsum -- -v ./... | ||
$(GOBIN)/gotestsum -- -v ./server/... ./build/... | ||
endif | ||
ifneq ($(HAS_WEBAPP),) | ||
cd webapp && $(NPM) run test; | ||
|
@@ -320,7 +320,7 @@ endif | |
.PHONY: test-ci | ||
test-ci: apply webapp/node_modules install-go-tools | ||
ifneq ($(HAS_SERVER),) | ||
$(GOBIN)/gotestsum --format standard-verbose --junitfile report.xml -- ./... | ||
$(GOBIN)/gotestsum --format standard-verbose --junitfile report.xml -- ./server/... | ||
endif | ||
ifneq ($(HAS_WEBAPP),) | ||
cd webapp && $(NPM) run test; | ||
|
@@ -330,7 +330,7 @@ endif | |
.PHONY: coverage | ||
coverage: apply webapp/node_modules | ||
ifneq ($(HAS_SERVER),) | ||
$(GO) test $(GO_TEST_FLAGS) -coverprofile=server/coverage.txt ./server/... | ||
$(GO) test $(GO_TEST_FLAGS) -coverprofile=server/coverage.txt ./server/... ./build/... | ||
$(GO) tool cover -html=server/coverage.txt | ||
endif | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mattermost-webapp/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build | ||
node_modules | ||
.npminstall | ||
mattermost-webapp |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
readonly COMMITHASH=`jq -r '.localPackages.mattermost_webapp' package.json` | ||
|
||
echo "\n\nInstalling mattermost-webapp from the mattermost repo, using commit hash $COMMITHASH\n" | ||
|
||
if [ ! -d mattermost-webapp ]; then | ||
mkdir mattermost-webapp | ||
fi | ||
|
||
cd mattermost-webapp | ||
|
||
if [ ! -d .git ]; then | ||
git init | ||
git config --local uploadpack.allowReachableSHA1InWant true | ||
git remote add origin https://github.com/mattermost/mattermost.git | ||
fi | ||
|
||
git fetch --depth=1 origin $COMMITHASH | ||
git reset --hard FETCH_HEAD | ||
|
||
cd .. | ||
mv mattermost-webapp/webapp . | ||
rm -rf mattermost-webapp | ||
mv webapp mattermost-webapp | ||
|
||
npm i --save-dev ./mattermost-webapp/channels | ||
npm i --save-dev ./mattermost-webapp/platform/types | ||
npm i --save-dev ./mattermost-webapp/platform/client | ||
Kshitij-Katiyar marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem like unrelated changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was facing a very peculiar error https://github.com/mattermost/mattermost-plugin-jira/actions/runs/8938919453/job/24553976441, so there was a package named file-hound of frontend, and after it was installed, it was creating an empty go file, and in the lint as well as test CI, we run commands like go test ./... which basically going to work on all files including the node modules and that's why we were getting the above error. So for now I have made the go commands to only work in the server folder and not outside of it.
@hanzei
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the problem @hanzei may have with this is that the
build
folder is no longer being checked. Can we instead make it so onlywebapp
exists in the monorepo checkout folder? Either we can do something replacing the whole repo with just thewebapp
directory like:mv mattermost-webapp/webapp . rm -rf mattermost-webapp mv webapp mattermost-webapp
Naming the cloned directory just
mattermost
may make more sense here. Then this becomes:mv mattermost/webapp . rm -rf mattermost mv webapp mattermost-webapp
Alternatively we can do a sparse checkout, but that seems more complicated https://stackoverflow.com/a/52270636