...
 
Commits (2138)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

{
"presets": [
"es2015",
"react",
"stage-0"
]
presets: [
['@babel/preset-env', {
targets: {
chrome: 66,
firefox: 60,
edge: 42,
ie: 11,
safari: 12,
},
modules: false,
debug: false,
useBuiltIns: 'usage',
shippedProposals: true,
}],
['@babel/preset-react', {
useBuiltIns: true,
}],
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
env: {
test: {
presets: [
['@babel/preset-env', {
targets: {
chrome: 66,
firefox: 60,
edge: 42,
ie: 11,
safari: 12,
},
debug: false,
useBuiltIns: 'usage',
shippedProposals: true,
}],
['@babel/preset-react', {
useBuiltIns: true,
}],
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
}
}
}
version: 2.1
executors:
default:
working_directory: ~/mattermost-webapp
docker:
- image: mattermost/mattermost-build-webapp:oct-2-2018
aliases:
- &restore_cache
restore_cache:
key: dependencies-{{ checksum "package-lock.json" }}
- &save_cache
save_cache:
key: dependencies-{{ checksum "package-lock.json" }}
paths:
- node_modules
jobs:
install:
executor:
name: default
steps:
- checkout
- *restore_cache
- run: |
npm ci
cd node_modules/mattermost-redux && npm i && npm run build
- *save_cache
lint:
executor:
name: default
steps:
- checkout
- *restore_cache
- run: |
npm run check
test:
executor:
name: default
steps:
- checkout
- *restore_cache
- run: npm run test-ci
- store_test_results:
path: build/
build:
executor:
name: default
steps:
- checkout
- *restore_cache
- run: make package-ci
- store_artifacts:
path: ~/mattermost-webapp/mattermost-webapp.tar.gz
- run:
name: Upload to S3
command: |
if [[ -z "${CIRCLE_PULL_REQUEST:-}" ]]; then
echo "Not a PR using the branch name ${CIRCLE_BRANCH}..."
export FOLDER_NAME=${CIRCLE_BRANCH}
echo "${FOLDER_NAME}"
else
echo "This is a PR ${CIRCLE_BRANCH}..."
export FOLDER_NAME=$(echo "${CIRCLE_BRANCH}" | sed 's/pull\//PR-/g')
echo "${FOLDER_NAME}"
fi
curl --request POST \
--url "https://lambdas.devops.mattermost.com/circleci/uploader?token=${UPLOADER_TOKEN}&vcs-type=github&username=${CIRCLE_PROJECT_USERNAME}&project=${CIRCLE_PROJECT_REPONAME}&build_num=${CIRCLE_BUILD_NUM}&bucket=releases.mattermost.com/${CIRCLE_PROJECT_REPONAME}/${FOLDER_NAME}/"
- run:
name: Upload to S3 - SHA1
command: |
curl --request POST \
--url "https://lambdas.devops.mattermost.com/circleci/uploader?token=${UPLOADER_TOKEN}&vcs-type=github&username=${CIRCLE_PROJECT_USERNAME}&project=${CIRCLE_PROJECT_REPONAME}&build_num=${CIRCLE_BUILD_NUM}&bucket=releases.mattermost.com/${CIRCLE_PROJECT_REPONAME}/commit/${CIRCLE_SHA1}/"
workflows:
version: 2
untagged-build:
jobs:
- install
- lint:
requires:
- install
- test:
requires:
- lint
- build:
requires:
- test
......@@ -5,6 +5,7 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
[*.go]
......@@ -14,7 +15,7 @@ indent_style = tab
indent_style = space
indent_size = 4
[package.json]
[{package.json,.eslintrc.json}]
indent_size = 2
[i18n/**.json]
......
This diff is collapsed.
dist
.npminstall
.yarninstall
node_modules
*.swp
......@@ -7,3 +8,9 @@ node_modules
tests/reports
.DS_Store
mattermost-webapp.iml
.vscode/
# disable folders generated by Cypress
cypress/screenshots
cypress/videos
results
# Code Contribution Guidelines
Thank you for your interest in contributing! Please see the [Mattermost Contribution Guide](https://developers.mattermost.com/contribute/getting-started/) which describes the process for making code contributions across Mattermost projects and [join our "Contributors" community channel](https://pre-release.mattermost.com/core/channels/tickets) to ask questions from community members and the Mattermost core team.
### Review Process for this Repo
When you submit a pull request, it goes through the review process outlined below. We aim to start reviewing pull requests in this repo the week they are submitted, but the length of time to complete the process will vary depending on the pull request.
The one exception may be around release time, where the review process may take longer as the team focuses on our [release process](https://docs.mattermost.com/process/release-process.html).
#### PR submitted
After a PR is submitted, a core committer applies labels and notifies product managers (PMs) that there is a PR awaiting review by posting in the [PM/Docs PR Review channel](https://pre-release.mattermost.com/core/channels/pmdocs-pr-review-pub), which is a channel to discuss community pull requests that need review by PMs.
Then, one or more of the labels is applied:
- `Awaiting PR`: Applied if the PR is awaiting another to be merged. For example, when a client PR is awaiting a server PR to be merged first. Once the PR is no longer blocked, the core committer removes the `Awaiting PR` label.
- `1: PM Review`: Applied if the PR has UI changes or functionality that PMs can test on test servers called "spinmints".
- `Major Change`: Applied if the PR is a major feature or affects large areas of the code base, e.g. [moving channel store and actions to Redux](https://github.com/mattermost/platform/pull/6235).
- `Setup Test Server`: Applied if the PR is queued for PM testing.
- `Work in Progress`: Applied if the PR is unfinished and needs further work before it's ready for review.
#### Stage 1: PM Review
A product manager (PM) will review the pull request to make sure it:
- Fits with our product roadmap.
- Works as described in the ticket.
- Meets [user experience guidelines](https://docs.mattermost.com/developer/fx-guidelines.html).
This step is sometimes skipped for bugs or small improvements with a well-defined ticket. In this case the core committer will assign the appropriate devs for review. A PM can also ask developer support to set up a separate test instance if the PR cannot be easily tested.
When the review process begins:
- Mattermost Core Committer
- Assigns `1: PM Review` label within 1 business day after the PR is submitted.
- Assigns PM reviewer under Assignees. Those related to end user features are assigned to @esethna, others to @jasonblais. PM re-assigns as needed.
- PM
- Applies milestone for next release if the PM thinks there is enough time for the PR to be merged and sufficiently tested on `master` before code complete. Otherwise moved to a future release, letting submitter know that PR may have a delay in review due to the release cycle.
- Follows up with contributor if the CLA has not been signed. If no response within 7 days, PM closes the issue.
- PM verifies there is a corresponding JIRA ticket or GitHub issue.
Next, the PM tests changes on a spinmint test server:
- PM tests and verifies pull requests via the `Setup Test Server` label. Initial review is completed within 2 business days.
- If changes are required, PM submits review as "Changes Requested", with a comment on the areas that require updates. Comment explains why changes are needed linking back to design principles.
- PM applies `Awaiting Submitter Action` label to more easily query the PR queue.
- Once changes are made, PM regenerates test server and repeats testing.
- If bugs are found that are also on `master`, a new bug report is submitted in JIRA and linked to the PR. Bugs that are also found on `master` will typically not block merging of PRs.
- If PR is approved, PM submits review as "Approved", commenting with areas that were tested.
#### Stage 2: Dev Review
Two developers will review the pull request and either give feedback or approve the PR. Any comments should be addressed before the pull request moves on to the next stage.
- PM reviewer adds `2: Dev Review` label, removes `1: PM Review` and `Setup Test Server` labels, and assigns 2 developers for review under Reviewers.
- At least one dev is assigned based on their [feature area](https://docs.mattermost.com/developer/core-developer-handbook.html#current-core-developers). Devs re-assign as needed.
- Devs review the code and provide feedback, with initial review completed within 2 business days. Some areas to check include:
- Proper Unit Tests
- API documentation
- Localization
- After the submitter has addressed and satisfied all reviewers' comments, `3: Ready to Merge` label is applied.
#### Stage 3: Ready to Merge
Review process is complete and the pull request is merged.
- Dev assigns `3: Ready to Merge` label.
- If Mattermost is not in release mode (between [major feature cut and release candidate cut](https://docs.mattermost.com/process/release-process.html)), the PR is merged into `master`.
- If the PR is a major change, merge is postponed until the next release cycle.
- Dev calls out on the issue that it is a major change and it will be merged after branching.
- Once the current release is branched the PR can be merged into `master`.
#### PR Merged
After a PR is merged:
- External Contributions: PM closes the [Help Wanted] issue and related JIRA ticket.
- Internal Contributions: Core committer resolves the JIRA ticket.
- PM follows up for docs and changelog, and QA for release tests.
.PHONY: build test run clean stop check-style run-unit emojis help
.PHONY: build test run clean stop check-style run-unit emojis help package-ci
BUILD_SERVER_DIR = ../mattermost-server
BUILD_WEBAPP_DIR = ../mattermost-webapp
MM_UTILITIES_DIR = ../mattermost-utilities
EMOJI_TOOLS_DIR = ./build/emoji
check-style: .yarninstall ## Checks JS file for ESLint confirmity
check-style: node_modules ## Checks JS file for ESLint confirmity
@echo Checking for style guide compliance
yarn run check
npm run check
test: .yarninstall ## Runs tests
test: node_modules ## Runs tests
@echo Running jest unit/component testing
yarn run test
npm run test
.yarninstall: package.json
@echo Getting dependencies using yarn
i18n-extract: ## Extract strings for translation from the source code
@[[ -d $(MM_UTILITIES_DIR) ]] || echo "You must clone github.com/mattermost/mattermost-utilities repo in .. to use this command"
@[[ -d $(MM_UTILITIES_DIR) ]] && cd $(MM_UTILITIES_DIR) && npm install && npm run babel && node mmjstool/build/index.js i18n extract-webapp
yarn install
cd node_modules/mattermost-redux; npm run build
node_modules: package.json package-lock.json
@echo Getting dependencies using npm
touch $@
npm install
package: build ## Packages app
@echo Packaging webapp
......@@ -30,22 +33,36 @@ package: build ## Packages app
mv tmp/client dist
rmdir tmp
build: .yarninstall ## Builds the app
package-ci: ## used in the CI to build the package and bypass the npm install
@echo Building mattermost Webapp
rm -rf dist
npm run build
yarn run build
@echo Packaging webapp
mkdir tmp
mv dist tmp/client
tar -C tmp -czf mattermost-webapp.tar.gz client
mv tmp/client dist
rmdir tmp
run: .yarninstall ## Runs app
build: node_modules ## Builds the app
@echo Building mattermost Webapp
rm -rf dist
npm run build
run: node_modules ## Runs app
@echo Running mattermost Webapp for development
yarn run run &
npm run run &
run-fullmap: .yarninstall ## Runs the app with the JS mapped to source (good for debugger)
@echo FULL SOURCE MAP Running mattermost Webapp for development FULL SOURCE MAP
run-fullmap: node_modules ## Legacy alias to run
@echo Running mattermost Webapp for development
yarn run run-fullmap &
npm run run &
stop: ## Stops webpack
@echo Stopping changes watching
......@@ -59,14 +76,59 @@ else
done
endif
restart: | stop run ## Restarts the app
clean: ## Clears cached; deletes node_modules and dist directories
@echo Cleaning Webapp
yarn cache clean
rm -rf dist
rm -rf node_modules
rm -f .yarninstall
e2e: node_modules
@echo E2E: Running mattermost-mysql-e2e
@if [ $(shell docker ps -a | grep -ci mattermost-mysql-e2e) -eq 0 ]; then \
echo starting mattermost-mysql-e2e; \
docker run --name mattermost-mysql-e2e -p 35476:3306 -e MYSQL_ROOT_PASSWORD=mostest \
-e MYSQL_USER=mmuser -e MYSQL_PASSWORD=mostest -e MYSQL_DATABASE=mattermost_test -d mysql:5.7 > /dev/null; \
elif [ $(shell docker ps | grep -ci mattermost-mysql-e2e) -eq 0 ]; then \
echo restarting mattermost-mysql-e2e; \
docker start mattermost-mysql-e2e > /dev/null; \
fi
cd $(BUILD_SERVER_DIR) && [[ -f config/config.json ]] && \
cp config/config.json config/config-backup.json && cp config/default.json config/config.json || \
echo "config.json not found" && cp config/default.json config/config.json
@echo E2E: Starting the server
cd $(BUILD_SERVER_DIR) && $(MAKE) run
@echo E2E: Generating test data
cd $(BUILD_SERVER_DIR) && $(MAKE) test-data
@echo E2E: Running end-to-end testing
npm run cypress:run
@echo E2E: Stoppping the server
cd $(BUILD_SERVER_DIR) && $(MAKE) stop
@echo E2E: stopping mattermost-mysql-e2e
docker stop mattermost-mysql-e2e > /dev/null
cd $(BUILD_SERVER_DIR) && [[ -f config/config-backup.json ]] && \
cp config/config-backup.json config/config.json && echo "revert local config.json" || \
echo "config-backup.json not found" && sed -i'' -e 's|"DataSource": ".*"|"DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s"|g' config/config.json
@echo E2E: Tests completed
clean-e2e:
@if [ $(shell docker ps -a | grep -ci mattermost-mysql-e2e) -eq 1 ]; then \
echo stopping mattermost-mysql-e2e; \
docker stop mattermost-mysql-e2e > /dev/null; \
fi
cd $(BUILD_SERVER_DIR) && [[ -f config/config-backup.json ]] && \
cp config/config-backup.json config/config.json && echo "revert local config.json" || \
echo "config-backup.json not found" && sed -i'' -e 's|"DataSource": ".*"|"DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s"|g' config/config.json
emojis: ## Creates emoji JSX file and extracts emoji images from the system font
gem install bundler