Skip to content

Commit

Permalink
Merge branch 'master' into taskinbox-integrate
Browse files Browse the repository at this point in the history
* master: (250 commits)
  [MM-46891] Fix collapsed LHS (#1485)
  Fix styled component errors (#1491)
  Fix a setState after unmount (#1493)
  Mm 44497 playbook refresh issues (#1486)
  Remove fetch type checking (#1492)
  Telemetry: new approach draft + PostUpdate viewed (#1470)
  Private channel/playbook in run overview at RDP (#1481)
  MM-47028 Use version of React DOM provided by web app (#1489)
  more nesting allowed for pull requests (#1476)
  add missing icons from mdi to compass (#1474)
  add portal-false to dotmenu in pbe manage members (#1479)
  clean unused code inside backstage (#1475)
  Improved logging (#1271)
  Translated using Weblate (Turkish)
  Translated using Weblate (Croatian)
  Translated using Weblate (Hungarian)
  Translated using Weblate (Dutch)
  Translated using Weblate (English (Australia))
  Translated using Weblate (Polish)
  Translated using Weblate (Hungarian)
  ...
  • Loading branch information
trilopin committed Oct 3, 2022
2 parents e327d14 + c644414 commit ba3348b
Show file tree
Hide file tree
Showing 404 changed files with 20,230 additions and 32,102 deletions.
10 changes: 8 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ commands:
no_output_timeout: 30m
command: |
cd tests-e2e
circleci tests glob "cypress/integration/**/*.js" | circleci tests split --split-by=timings > ./tests-to-run
npm run test -- --spec "$(cat ./tests-to-run | tr '\n' ',')"
SPECS=$(circleci tests glob "cypress/integration/**/*.js" | circleci tests split --split-by=timings | tr '\n' ',')
SPECS=${SPECS::-1}
npm run test -- --spec "${SPECS}"
- *save_cypress_cache
- store_test_results:
path: tests-e2e/cypress/results/junit
Expand All @@ -176,6 +177,11 @@ jobs:
- *restore_go_cache
- npm-dependencies
- npm-e2e-dependencies
# Base image already bundle a golanci-lint but it's not updated enough (staticcheck linter needed)
- run:
name: install golangci-lint 1.46.2
command: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin v1.46.2
- run:
name: Checking code style
command: |
Expand Down
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ REMEMBER TO:
- Run `make test` to ensure unit tests passed
-->

#### Summary
## Summary
<!--
A description of what this pull request does
-->

#### Ticket Link
## Ticket Link
<!--
If this pull request addresses a Help Wanted ticket, please link the relevant GitHub issue, e.g.:
Expand All @@ -24,7 +24,7 @@ If this pull request addresses a Help Wanted ticket, please link the relevant Gi
Otherwise, link the Jira ticket.
-->

#### Checklist
## Checklist
<!-- Check off items as they are completed. ~~Strike through~~ items if they don't apply -->
- [ ] Telemetry updated
- [ ] Gated by experimental feature flag
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ dist
tests-e2e/node_modules
tests-e2e/cypress/screenshots
tests-e2e/cypress/videos
tests-e2e/cypress/results
.eslintcache
report.xml

webapp/src/manifest.js
server/manifest.go
server/data/
server/e2etest.config.json
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ linters:
- ineffassign
- exportloopref
- staticcheck
- structcheck
- unconvert
- unused
- varcheck
# disabled until is compatible with go1.18 https://github.com/golangci/golangci-lint/issues/2649
# - structcheck

linters-settings:
gofmt:
Expand Down
3 changes: 3 additions & 0 deletions .ts-prunerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore": "used in module|generated_types"
}
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ apply:

## Runs eslint and golangci-lint
.PHONY: check-style
check-style: apply webapp/node_modules
check-style: apply webapp/node_modules check-golangci
@echo Checking for style guide compliance

ifneq ($(HAS_WEBAPP),)
Expand All @@ -56,16 +56,20 @@ endif
cd tests-e2e && npm run check

ifneq ($(HAS_SERVER),)
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
echo "golangci-lint is not installed. Please see https://github.com/golangci/golangci-lint#install for installation instructions."; \
exit 1; \
fi; \
@echo Running golangci-lint
golangci-lint --version
golangci-lint run ./...
$(GOBIN)/golangci-lint run ./...
endif

.PHONY: check-golangci
check-golangci:
ifneq ($(HAS_SERVER),)
@echo Ckecking golangci-lint

@# Keep the version in sync with the command in .circleci/config.yml
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2
endif


## Builds the server, if it exists, for all supported architectures, unless MM_SERVICESETTINGS_ENABLEDEVELOPER is set
.PHONY: server
server:
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,34 @@ This plugin contains both a server and web app portion. Read our documentation a

For more information about contributing to Mattermost, and the different ways you can contribute, see https://www.mattermost.org/contribute-to-mattermost.

### Logging

Logging should use the logrus package (not `pluginAPI.Log`, `mlog`, or `log`). The standard logger is automatically wired into the pluginAPI and proxied through the server:

```go
logger := logrus.WithField("playbook_run_id", playbookRunID)

err := findUserForPlaybookRunAndTeam(playbookRunID, userID, teamID)
if err != nil {
logrus.WithError(err).WithFields(logrus.Fields{
"user_id": userID,
"team_id": teamID,
}).Warn("Failed to find user for playbook run and team")
}
```

A few guidelines when logging:
* Use the appropriate level:
* Error: an error log should require some human action to fix something upon receipt
* Warn: a warning log might require investigation if it occurs in bulk, but does not require human action
* Info: a information log provides context that will typically be logged by default
* Debug: a debug log provides context that will typically be logged only on demand
* Write static log messages (`Failed to find user for playbook run and team`) instead of interpolating parameters into the log message itself (`Failed to find user %s for playbook run %s and team %s`)
* Use snake case when naming fields. Try to name these fields consistently with other usage.
* Pass errors using `WithError`.
* Use `WithFields` when passing more than one field that is not an `err`.
* Common fields can be set once instead of being passed for every log

## Popular searches for Help Wanted issues:

* [Help wanted tickets currently up for grab](https://github.com/mattermost/mattermost-server/issues?q=is%3Aopen+is%3Aissue+label%3AArea%2FPlaybooks+label%3A%22Up+For+Grabs%22)
Expand Down
12 changes: 12 additions & 0 deletions assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,17 @@
{
"id": "app.command.execute.error",
"translation": "Kann Befehl nicht ausführen."
},
{
"id": "app.user.run.request_update",
"translation": "@here — @{{.Name}} hat eine Statusaktualisierung angefordert. \n"
},
{
"id": "app.user.run.request_get_involved",
"translation": "@here - @{{.Name}} möchten an diesem Durchlauf teilnehmen. Um sie als Teilnehmer hinzuzufügen, füge sie bitte diesem Kanal hinzu.\n"
},
{
"id": "app.user.run.retro_publish",
"translation": "@{{.Name}} hat eine Retrospektive veröffentlicht\n[Ganze Retrospektive ansehen]({{.URL}})\n"
}
]
14 changes: 11 additions & 3 deletions assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,19 @@
"translation": "You have 0 assigned tasks."
},
{
"id": "app.user.run.request_get_involved",
"translation": "@here — @{{.Name}} wants to get involved in this run. To let them become a member of the run, please add them to this channel.\n"
"id": "app.user.run.joined_run_channel_private_add_participant",
"translation": "@{{.Name}} has been added to the run by @{{.RequesterName}}. They haven't been automatically added to the channel because @{{.RequesterName}} isn't a channel member and the channel is private.\n"
},
{
"id": "app.user.run.joined_run_channel_private_participate",
"translation": "@{{.Name}} has joined the run. They haven't been automatically added to this private channel but any member of the channel can invite them to join.\n"
},
{
"id": "app.user.run.request_join_channel",
"translation": "@{{.Name}} is a run participant and wants join this channel. Any member of the channel can invite them.\n"
},
{
"id": "app.user.run.request_update",
"translation": "@here — @{{.Name}} requested a status update.\n"
"translation": "@here — @{{.Name}} requested a status update. \n"
}
]
8 changes: 8 additions & 0 deletions assets/i18n/hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,13 @@
"few": "Imaš **{{.Count}} dodijeljena zadatka s rokom nakon danas**.",
"other": "Imaš **{{.Count}} dodijeljenih zadataka s rokom nakon danas**."
}
},
{
"id": "app.user.run.request_update",
"translation": "@here – @{{.Name}} je zatražio/la aktualiziranje stanja. \n"
},
{
"id": "app.user.run.request_get_involved",
"translation": "@here – @{{.Name}} želi sudjelovati u ovom izvođenju. Da bi postali članovi izvođenja, dodaj ih ovom kanalu.\n"
}
]
100 changes: 100 additions & 0 deletions assets/i18n/hu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
[
{
"id": "app.user.digest.tasks.due_after_today",
"translation": {
"one": "Önnek van **{{.Count}} Önhöz rendelt feladat aminek a határideje ma után van**.",
"other": "Önnek van **{{.Count}} Önhöz rendelt feladat aminek a határideje ma után van**."
}
},
{
"id": "app.user.digest.tasks.num_assigned",
"translation": {
"one": "Önhöz {{.Count}} feladat van hozzárendelve:",
"other": "Önhöz {{.Count}} feladat van hozzárendelve:"
}
},
{
"id": "app.user.digest.tasks.due_in_x_days",
"translation": {
"one": "Határidő lejár {{.Count}} nap múlva",
"other": "Határidő lejár {{.Count}} nap múlva"
}
},
{
"id": "app.user.digest.tasks.num_assigned_due_until_today",
"translation": {
"one": "Önnek {{.Count}} Önhöz rendelt feladata van késedelemben:",
"other": "Önnek {{.Count}} Önhöz rendelt feladata van késedelemben:"
}
},
{
"id": "app.user.run.request_get_involved",
"translation": "@here — @{{.Name}} részt szeretne venni ebben a futásban. Ahhoz, hogy résztvevők lehessenek, adja hozzá őket ehhez a csatornához.\n"
},
{
"id": "app.user.run.request_update",
"translation": "@here — @{{.Name}} kért egy állapot frissítést. \n"
},
{
"id": "app.user.digest.tasks.zero_assigned",
"translation": "Önhöz 0 feladat van hozzárendelve."
},
{
"id": "app.user.digest.tasks.heading",
"translation": "Önhöz rendelt feladatok"
},
{
"id": "app.user.digest.tasks.due_yesterday",
"translation": "Tegnap lejárt"
},
{
"id": "app.user.digest.tasks.due_x_days_ago",
"translation": "Határidő lejárt {{.Count}} nappal ezelőtt"
},
{
"id": "app.user.digest.tasks.due_today",
"translation": "Határidő ma"
},
{
"id": "app.user.digest.tasks.all_tasks_command",
"translation": "Kérem használja a `/playbook todo` parancsot az összes feladat megtekintéséhez."
},
{
"id": "app.user.digest.runs_in_progress.zero_in_progress",
"translation": "Önnek 0 futása van éppen folyamatban."
},
{
"id": "app.user.digest.overdue_status_updates.num_overdue",
"translation": {
"one": "Önnek {{.Count}} futása van lejárt állapot frissítéssel:",
"other": "Önnek {{.Count}} futása van lejárt állapot frissítéssel:"
}
},
{
"id": "app.user.digest.runs_in_progress.num_in_progress",
"translation": {
"one": "Önnek {{.Count}} futása van folyamatban:",
"other": "Önnek {{.Count}} futása van folyamatban:"
}
},
{
"id": "app.user.digest.overdue_status_updates.zero_overdue",
"translation": "Önnek 0 futása van késedelemben."
},
{
"id": "app.user.digest.overdue_status_updates.heading",
"translation": "Késedelmes állapot frissítések"
},
{
"id": "app.command.execute.error",
"translation": "Nem sikerült végrehajtani a parancsot."
},
{
"id": "app.user.digest.runs_in_progress.heading",
"translation": "Futások folyamatban"
},
{
"id": "app.user.run.retro_publish",
"translation": "@{{.Name}} közzétett egy visszatekintőt\n[A teljes visszatekintő megtekintése]({{.URL}})\n"
}
]
12 changes: 12 additions & 0 deletions assets/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,17 @@
{
"id": "app.command.execute.error",
"translation": "Nie można wykonać polecenia."
},
{
"id": "app.user.run.request_update",
"translation": "@here - @{.Name}} poprosił o aktualizację statusu. \n"
},
{
"id": "app.user.run.request_get_involved",
"translation": "@here - @{.Name}} chce wziąć udział w tym uruchomieniu. Aby uwzględnić ich jako uczestników, dodaj ich do tego kanału.\n"
},
{
"id": "app.user.run.retro_publish",
"translation": "@{.Name}} opublikował retrospektywę\n[Zobacz pełną retrospektywę]({{.URL}}).\n"
}
]
8 changes: 8 additions & 0 deletions assets/i18n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,13 @@
"one": "Du har {{.Count}} körning som borde ha fått en statusuppdatering:",
"other": "Du har {{.Count}} körningar som borde ha fått en statusuppdatering:"
}
},
{
"id": "app.user.run.request_update",
"translation": "@here - @{{.Name}} begärde en statusuppdatering. \n"
},
{
"id": "app.user.run.request_get_involved",
"translation": "@here - @{{.Name}} vill delta i denna körning. Om du vill inkludera dem som deltagare lägger du till dem i den här kanalen.\n"
}
]
12 changes: 12 additions & 0 deletions assets/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,17 @@
{
"id": "app.command.execute.error",
"translation": "Komut yürütülemedi."
},
{
"id": "app.user.run.request_update",
"translation": "@here — @{{.Name}} bir durum güncellemesi istedi. \n"
},
{
"id": "app.user.run.request_get_involved",
"translation": "@here — @{{.Name}} bu oyuna katılmak istiyor. Oyuna katılabilmesi için lütfen onu bu kanala ekleyin.\n"
},
{
"id": "app.user.run.retro_publish",
"translation": "@{{.Name}} bir geçmiş değerlendirmesi yayınladı\n[Geçmiş değerlendirmesine bakın]({{.URL}})\n"
}
]
1 change: 0 additions & 1 deletion build/custom.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ GO_BUILD_FLAGS += -ldflags "-X main.rudderDataplaneURL=$(MM_RUDDER_DATAPLANE_URL
## Generate mocks.
mocks:
ifneq ($(HAS_SERVER),)
mockgen -destination server/bot/mocks/mock_logger.go github.com/mattermost/mattermost-plugin-playbooks/server/bot Logger
mockgen -destination server/bot/mocks/mock_poster.go github.com/mattermost/mattermost-plugin-playbooks/server/bot Poster
mockgen -destination server/app/mocks/mock_job_once_scheduler.go github.com/mattermost/mattermost-plugin-playbooks/server/app JobOnceScheduler
mockgen -destination server/sqlstore/mocks/mock_kvapi.go github.com/mattermost/mattermost-plugin-playbooks/server/sqlstore KVAPI
Expand Down
6 changes: 6 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ type Client struct {
Actions *ActionsService
// Stats is a collection of methods used to interact with stats.
Stats *StatsService
// Reminders is a collection of methods used to interact with reminders.
Reminders *RemindersService
// Telemetry is a collection of methods used to interact with telemetry.
Telemetry *TelemetryService
}

// New creates a new instance of Client using the configuration from the given Mattermost Client.
Expand All @@ -71,6 +75,8 @@ func newClient(mattermostSiteURL string, httpClient *http.Client) (*Client, erro
c.Settings = &SettingsService{c}
c.Actions = &ActionsService{c}
c.Stats = &StatsService{c}
c.Reminders = &RemindersService{c}
c.Telemetry = &TelemetryService{c}
return c, nil
}

Expand Down
Loading

0 comments on commit ba3348b

Please sign in to comment.