Skip to content

Commit

Permalink
Removed mattermost-plugin from make rules (#5030)
Browse files Browse the repository at this point in the history
* removed mattermost-plugin from make rules

* removed: mattermost-plugin code from the repo

* updated snapshot and fix test (#5031)

* updated snapshot and fix test

* Updated snapshot and removed unnecessary tests

* chore: minor fix ci

* refactor: updated the mac-os version supported by github actions

* reverted: mac os version

* refactor: updated mac os version and also changed docker-compose to docker compose
  • Loading branch information
Rajat-Dabade authored and toninis committed Aug 28, 2024
1 parent 6c9eff7 commit 6e7aa2d
Show file tree
Hide file tree
Showing 31 changed files with 350 additions and 2,279 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ node_modules
.github/
mac/
win-wpf/
mattermost-plugin/
website/
linux/
go.work
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ jobs:
with:
path: "focalboard"
- name: npm ci
run: |
cd focalboard/webapp && npm ci && cd -
cd focalboard/mattermost-plugin/webapp && npm ci
run: cd focalboard/webapp && npm ci && cd -

- name: Set up Go
uses: actions/setup-go@v3
Expand Down Expand Up @@ -98,7 +96,7 @@ jobs:
run: cd focalboard; make server-test-mini-${{matrix['db']}}

ci-mac-server:
runs-on: macos-11
runs-on: macos-12

strategy:
matrix:
Expand Down
80 changes: 3 additions & 77 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,10 @@ jobs:

- name: Replace token 1 server
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 1 webapp
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx


- name: Replace token 2 server
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_DEV_KEY }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 2 webapp
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_DEV_KEY }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx


- name: npm ci
run: cd focalboard/webapp; npm ci --no-optional

Expand Down Expand Up @@ -72,7 +66,7 @@ jobs:
path: ${{ github.workspace }}/focalboard/linux/dist/focalboard-linux.tar.gz

macos:
runs-on: macos-11
runs-on: macos-12

steps:

Expand All @@ -83,15 +77,9 @@ jobs:
- name: Replace token 1 server
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 1 webapp
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: Replace token 2 server
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_DEV_KEY }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 2 webapp
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_DEV_KEY }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: npm ci
run: cd focalboard/webapp; npm ci --no-optional

Expand Down Expand Up @@ -126,15 +114,6 @@ jobs:
- name: Replace token 1 server
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 1 webapp
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: Replace token 2 server
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_DEV_KEY }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 2 webapp
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_DEV_KEY }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: Add msbuild to PATH
uses: microsoft/[email protected]

Expand Down Expand Up @@ -170,56 +149,3 @@ jobs:
with:
name: focalboard-win.zip
path: ${{ github.workspace }}/focalboard/win-wpf/dist/focalboard-win.zip

plugin:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
path: "focalboard"

- name: Replace token 1 server
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 1 webapp
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: Replace token 2 server
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_DEV_KEY }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 2 webapp
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_DEV_KEY }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: npm ci
run: cd focalboard/webapp; npm ci --no-optional

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20.11.0

- name: Build webapp
run: cd focalboard; make webapp

- name: npm ci plugin dependencies
run: cd focalboard/mattermost-plugin/webapp; npm ci --no-optional

- name: Build plugin
run: cd focalboard/mattermost-plugin; make dist
env:
BUILD_NUMBER: ${{ github.run_id }}

- name: Rename plugin file
run: cd focalboard/mattermost-plugin/dist; mv focalboard-*.tar.gz mattermost-plugin-focalboard.tar.gz

- name: Upload plugin artifact
uses: actions/upload-artifact@v3
with:
name: mattermost-plugin-focalboard.tar.gz
path: ${{ github.workspace }}/focalboard/mattermost-plugin/dist/mattermost-plugin-focalboard.tar.gz
75 changes: 2 additions & 73 deletions .github/workflows/prod-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@ jobs:
- name: Replace token 1 server
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 1 webapp
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: Replace token 2 server
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_PROD_KEY }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 2 webapp
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_PROD_KEY }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: npm ci
run: cd focalboard/webapp; npm ci --no-optional

Expand Down Expand Up @@ -69,7 +63,7 @@ jobs:
path: ${{ github.workspace }}/focalboard/linux/dist/focalboard-linux.tar.gz

macos:
runs-on: macos-11
runs-on: macos-12

steps:

Expand All @@ -81,15 +75,9 @@ jobs:
- name: Replace token 1 server
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 1 webapp
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: Replace token 2 server
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_PROD_KEY }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 2 webapp
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_PROD_KEY }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: npm ci
run: cd focalboard/webapp; npm ci --no-optional

Expand Down Expand Up @@ -125,15 +113,9 @@ jobs:
- name: Replace token 1 server
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 1 webapp
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: Replace token 2 server
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_PROD_KEY }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 2 webapp
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_PROD_KEY }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: Add msbuild to PATH
uses: microsoft/[email protected]

Expand Down Expand Up @@ -169,57 +151,4 @@ jobs:
with:
name: focalboard-win.zip
path: ${{ github.workspace }}/focalboard/win-wpf/dist/focalboard-win.zip

plugin-release:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: "focalboard"

- name: Replace token 1 server
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 1 webapp
run: sed -i -e "s,placeholder_rudder_dataplane_url,${{ secrets.RUDDER_DATAPLANE_URL }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: Replace token 2 server
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_PROD_KEY }},g" ${{ github.workspace }}/focalboard/server/services/telemetry/telemetry.go

- name: Replace token 2 webapp
run: sed -i -e "s,placeholder_rudder_key,${{ secrets.RUDDER_PROD_KEY }},g" ${{ github.workspace }}/focalboard/mattermost-plugin/webapp/src/index.tsx

- name: npm ci
run: cd focalboard/webapp; npm ci --no-optional

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20.11.0

- name: Build webapp
run: cd focalboard; make webapp

- name: npm ci plugin dependencies
run: cd focalboard/mattermost-plugin/webapp && npm ci

- name: Build plugin
run: cd focalboard/mattermost-plugin; make dist
env:
BUILD_NUMBER: ${{ github.run_id }}

- name: Rename plugin file
run: cd focalboard/mattermost-plugin/dist; mv focalboard-*.tar.gz mattermost-plugin-focalboard.tar.gz

- name: Upload plugin artifact
uses: actions/upload-artifact@v3
with:
name: mattermost-plugin-focalboard.tar.gz
path: ${{ github.workspace }}/focalboard/mattermost-plugin/dist/mattermost-plugin-focalboard.tar.gz

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ webapp/cypress/screenshots
webapp/cypress/videos
server/swagger/clients
server/vendor
mattermost-plugin/vendor
mattermost-plugin/dist
.idea
docker/certs
docker/data
server/**/*.coverage
mattermost-plugin/**/*.coverage
34 changes: 9 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ all: webapp server ## Build server and webapp.

prebuild: ## Run prebuild actions (install dependencies etc.).
cd webapp; npm install
cd mattermost-plugin/webapp; npm install

ci: webapp-ci server-test ## Simulate CI, locally.

Expand Down Expand Up @@ -108,7 +107,6 @@ server-lint: ## Run linters on server code.
exit 1; \
fi;
cd server; golangci-lint run ./...
cd mattermost-plugin; golangci-lint run ./...

modd-precheck:
@if ! [ -x "$$(command -v modd)" ]; then \
Expand Down Expand Up @@ -144,61 +142,47 @@ server-test-mysql: export FOCALBOARD_STORE_TEST_DOCKER_PORT=44446

server-test-mysql: ## Run server tests using mysql
@echo Starting docker container for mysql
docker-compose -f ./docker-testing/docker-compose-mysql.yml down -v --remove-orphans
docker-compose -f ./docker-testing/docker-compose-mysql.yml run start_dependencies
docker compose -f ./docker-testing/docker-compose-mysql.yml down -v --remove-orphans
docker compose -f ./docker-testing/docker-compose-mysql.yml run start_dependencies
cd server; go test -tags '$(BUILD_TAGS)' -race -v -coverpkg=./... -coverprofile=server-mysql-profile.coverage -count=1 -timeout=30m ./...
cd server; go tool cover -func server-mysql-profile.coverage
cd mattermost-plugin/server; go test -tags '$(BUILD_TAGS)' -race -v -coverpkg=./... -coverprofile=plugin-mysql-profile.coverage -count=1 -timeout=30m ./...
cd mattermost-plugin/server; go tool cover -func plugin-mysql-profile.coverage
docker-compose -f ./docker-testing/docker-compose-mysql.yml down -v --remove-orphans
docker compose -f ./docker-testing/docker-compose-mysql.yml down -v --remove-orphans

server-test-mariadb: export FOCALBOARD_UNIT_TESTING=1
server-test-mariadb: export FOCALBOARD_STORE_TEST_DB_TYPE=mariadb
server-test-mariadb: export FOCALBOARD_STORE_TEST_DOCKER_PORT=44445

server-test-mariadb: templates-archive ## Run server tests using mysql
@echo Starting docker container for mariadb
docker-compose -f ./docker-testing/docker-compose-mariadb.yml down -v --remove-orphans
docker-compose -f ./docker-testing/docker-compose-mariadb.yml run start_dependencies
docker compose -f ./docker-testing/docker-compose-mariadb.yml down -v --remove-orphans
docker compose -f ./docker-testing/docker-compose-mariadb.yml run start_dependencies
cd server; go test -tags '$(BUILD_TAGS)' -race -v -coverpkg=./... -coverprofile=server-mariadb-profile.coverage -count=1 -timeout=30m ./...
cd server; go tool cover -func server-mariadb-profile.coverage
cd mattermost-plugin/server; go test -tags '$(BUILD_TAGS)' -race -v -coverpkg=./... -coverprofile=plugin-mariadb-profile.coverage -count=1 -timeout=30m ./...
cd mattermost-plugin/server; go tool cover -func plugin-mariadb-profile.coverage
docker-compose -f ./docker-testing/docker-compose-mariadb.yml down -v --remove-orphans
docker compose -f ./docker-testing/docker-compose-mariadb.yml down -v --remove-orphans

server-test-postgres: export FOCALBOARD_UNIT_TESTING=1
server-test-postgres: export FOCALBOARD_STORE_TEST_DB_TYPE=postgres
server-test-postgres: export FOCALBOARD_STORE_TEST_DOCKER_PORT=44447

server-test-postgres: ## Run server tests using postgres
@echo Starting docker container for postgres
docker-compose -f ./docker-testing/docker-compose-postgres.yml down -v --remove-orphans
docker-compose -f ./docker-testing/docker-compose-postgres.yml run start_dependencies
docker compose -f ./docker-testing/docker-compose-postgres.yml down -v --remove-orphans
docker compose -f ./docker-testing/docker-compose-postgres.yml run start_dependencies
cd server; go test -tags '$(BUILD_TAGS)' -race -v -coverpkg=./... -coverprofile=server-postgres-profile.coverage -count=1 -timeout=30m ./...
cd server; go tool cover -func server-postgres-profile.coverage
cd mattermost-plugin/server; go test -tags '$(BUILD_TAGS)' -race -v -coverpkg=./... -coverprofile=plugin-postgres-profile.coverage -count=1 -timeout=30m ./...
cd mattermost-plugin/server; go tool cover -func plugin-postgres-profile.coverage
docker-compose -f ./docker-testing/docker-compose-postgres.yml down -v --remove-orphans
docker compose -f ./docker-testing/docker-compose-postgres.yml down -v --remove-orphans

webapp: ## Build webapp.
cd webapp; npm run pack

webapp-ci: ## Webapp CI: linting & testing.
cd webapp; npm run check
cd mattermost-plugin/webapp; npm run lint
cd webapp; npm run test
cd mattermost-plugin/webapp; npm run test
cd webapp; npm run cypress:ci

webapp-test: ## jest tests for webapp
cd webapp; npm run test

watch-plugin: modd-precheck ## Run and upload the plugin to a development server
env FOCALBOARD_BUILD_TAGS='$(BUILD_TAGS)' modd -f modd-watchplugin.conf

live-watch-plugin: modd-precheck ## Run and update locally the plugin in the development server
cd mattermost-plugin; make live-watch

mac-app: server-mac webapp ## Build Mac application.
rm -rf mac/temp
rm -rf mac/dist
Expand Down
7 changes: 0 additions & 7 deletions modd-watchplugin.conf

This file was deleted.

2 changes: 0 additions & 2 deletions noticegen/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ title: "Mattermost Focalboard"
copyright: "©2015-present Mattermost,Inc. All Rights Reserved. See LICENSE for license information."
description: "This document includes a list of open source components used in Mattermost Focalboard, including those that have been modified."
search:
- "mattermost-plugin/go.mod"
- "mattermost-plugin/build/go.mod"
- "server/go.mod"
- "linux/go.mod"
dependencies: []
Expand Down
3 changes: 0 additions & 3 deletions server/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"github.com/mattermost/focalboard/server/model"
"github.com/mattermost/mattermost/server/public/shared/mlog"
"github.com/stretchr/testify/require"

pluginapi "github.com/mattermost/mattermost/server/public/pluginapi"
)

func TestErrorResponse(t *testing.T) {
Expand Down Expand Up @@ -47,7 +45,6 @@ func TestErrorResponse(t *testing.T) {
{"ErrNotFound", model.NewErrNotFound("board"), http.StatusNotFound, "board"},
{"ErrNotAllFound", model.NewErrNotAllFound("block", []string{"1", "2"}), http.StatusNotFound, "not all instances of {block} in {1, 2} found"},
{"sql.ErrNoRows", sql.ErrNoRows, http.StatusNotFound, "rows"},
{"mattermost-plugin-api/ErrNotFound", pluginapi.ErrNotFound, http.StatusNotFound, "not found"},
{"ErrNotFound", model.ErrCategoryDeleted, http.StatusNotFound, "category is deleted"},

// request entity too large
Expand Down
Loading

0 comments on commit 6e7aa2d

Please sign in to comment.