mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-22 18:25:27 -04:00
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / Check go fix (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres (shard 0) (push) Blocked by required conditions
Server CI / Postgres (shard 1) (push) Blocked by required conditions
Server CI / Postgres (shard 2) (push) Blocked by required conditions
Server CI / Postgres (shard 3) (push) Blocked by required conditions
Server CI / Merge Postgres Test Results (push) Blocked by required conditions
Server CI / Elasticsearch v8 Compatibility (push) Blocked by required conditions
Server CI / Postgres FIPS (shard 0) (push) Blocked by required conditions
Server CI / Postgres FIPS (shard 1) (push) Blocked by required conditions
Server CI / Postgres FIPS (shard 2) (push) Blocked by required conditions
Server CI / Postgres FIPS (shard 3) (push) Blocked by required conditions
Server CI / Merge Postgres FIPS Test Results (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Tools CI / check-style (mattermost-govet) (push) Waiting to run
Tools CI / Test (mattermost-govet) (push) Waiting to run
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Blocked by required conditions
Web App CI / check-external-links (push) Blocked by required conditions
Web App CI / check-types (push) Blocked by required conditions
Web App CI / test (platform) (push) Blocked by required conditions
Web App CI / test (mattermost-redux) (push) Blocked by required conditions
Web App CI / test (channels shard 1/4) (push) Blocked by required conditions
Web App CI / test (channels shard 2/4) (push) Blocked by required conditions
Web App CI / test (channels shard 3/4) (push) Blocked by required conditions
Web App CI / test (channels shard 4/4) (push) Blocked by required conditions
Web App CI / upload-coverage (push) Blocked by required conditions
Web App CI / build (push) Blocked by required conditions
YAML Lint / yamllint (push) Waiting to run
* Add board channel types (BO/BP) with POST /boards API
Introduces board channel types as a new channel variant that reuses the
Channels table but is fully isolated from all /channels endpoints.
Model:
- Add ChannelTypeOpenBoard ("BO") and ChannelTypePrivateBoard ("BP")
- Add IsBoard(), IsOpenBoard(), IsPrivateBoard() helpers
- Add board-specific websocket events (board_created/updated/deleted/restored)
Store:
- SaveBoardChannel: atomic channel + view creation in a single transaction
- Save() rejects board types (forces use of SaveBoardChannel)
- Exclude boards from all channel listing/search queries (GetTeamChannels,
GetAll, GetChannels, GetChannelsByUser, GetDeleted, autocomplete, search)
API:
- POST /boards: create board channel (feature-flagged behind IntegratedBoards)
- All /channels write endpoints reject board types with 400
- All /channels read endpoints reject or exclude board types
- Open boards get same public-read semantics as open channels
Tests:
- 15 rejection tests covering every /channels write + read endpoint
- 9 exclusion tests covering every listing/search endpoint
- 8 store tests for SaveBoardChannel + Save rejection
- 4 board creation API tests (create, private, flag off, sidebar exclusion)
- 3 authorization tests for board permission semantics
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update generated files: i18n, go.mod, migrations list
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add i18n translations for board channel error strings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix board guard ordering in getChannelMembers and getChannelStats
Move the board rejection check after the permission check so that
nonexistent channel IDs still return 403 (not 404) matching the
original behavior expected by TestGetChannelMembers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Filter boards at store level instead of API guards
Store.Get() now excludes board types via WHERE clause, making boards
invisible to all /channels endpoints. Added GetBoardChannel() for
/boards endpoints. Removed redundant API-level rejectBoardChannel
guards from 10 handlers that already call GetChannel(). Kept explicit
guards only on 3 handlers that don't fetch the channel.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix empty i18n translation for app.channel.save_member.app_error
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add board system properties, kanban column config, and audit logging
Migration:
- Register "boards" property group with system-wide Assignee (user) and
Status (select: Todo/In Progress/Complete) fields, both protected
- Idempotent migration following content flagging pattern
Board creation:
- Look up boards fields by name, set board:linked_properties on channel
- Build kanban view props with group_by mapping status options to columns
- Add typed KanbanProps/KanbanColumn/KanbanGroupBy structs with
ToProps()/KanbanPropsFromProps() for round-tripping
- Add audit record logging for POST /boards
- Add early team_id validation in API handler
- Error on missing status options instead of silent empty columns
Tests:
- Migration test: field creation + idempotent re-run
- Board creation test: verify kanban props + linked_properties
- Fix updateChannelMemberRoles test to use valid role string
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add boards migration mock to testlib store setup
The boards property migration calls System().GetByName() which needs
a matching mock expectation, same pattern as content_flagging_setup_done.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add kanban view props validation and tests
Validate kanban View.Props in IsValid(): group_by required with valid
field_id, 1-100 columns, each column needs id, name, and at least one
option_id. Update all test helpers to produce valid kanban props.
11 dedicated validation tests + round-trip test for KanbanProps.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Validate board display name is not empty
Add early DisplayName validation in CreateBoardChannel with a clear
error. Add tests for empty and whitespace-only display names.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Exclude boards from GetMany and getChannelsMemberCount
Add board type exclusion to Store.GetMany() and use filtered channel
IDs in getChannelsMemberCount handler so board channels don't leak
into member count results. Add test covering the endpoint.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix review issues: drop search indexing for boards, use request context
- Remove search layer indexing of board channels so they stay invisible
to Elasticsearch/Bleve-powered search and autocomplete
- Replace context.Background() with rctx.Context() for proper
cancellation and tracing in CreateBoardChannel
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix gofmt alignment in websocket_message.go after merge
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Regenerate server i18n after merge
* Restore translation for permission_policy.app_error
* Filter board channels in name lookups, autocomplete, and indexing
The store-layer board exclusion filter was missing from getByName,
getByNames, GetDeletedByName, the global Autocomplete, and
GetChannelsBatchForIndexing — leaving boards reachable via name
lookups, the no-team-filter search path, and admin reindex jobs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Reject boards in id-batch lookups, unread, and member-mutation endpoints
- GetChannelsByIds, GetChannelsWithTeamDataByIds, and GetChannelUnread
now exclude BO/BP at the store layer so boards can't slip through if
callers stop filtering first.
- updateChannelMemberNotifyProps, updateChannelMemberAutotranslation,
and viewChannel now reject board IDs explicitly via the existing
rejectBoardChannelByID helper, matching the other write endpoints.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Gate boards properties setup on the IntegratedBoards feature flag
doSetupBoardsProperties registered the boards property group and
fields at every server boot regardless of the IntegratedBoards
feature flag. Skip the migration when the flag is disabled so the
property metadata only appears once boards are actually enabled.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Use App accessors for boards property lookups
CreateBoardChannel reached into a.Srv().PropertyService() directly
instead of going through the App-level GetPropertyGroup and
GetPropertyFieldByName methods that already wrap the service. Switch
to the standard App accessors so the calls match the rest of the
codebase.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Log full channel input on createBoard audit record
createBoard only captured team_id and type on the audit record, so
failed creations lost most of the request payload. Use
AddEventParameterAuditableToAuditRec with the full channel struct,
matching createChannel.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Use allow-list of message channel types in store filters
Inverted every sq.NotEq{[BO, BP]} filter into sq.Eq{messageChannelTypes}
(or teamMessageChannelTypes for queries that also exclude direct
channels) so that any future non-message channel type — wikis, etc. —
is excluded by default rather than requiring every existing call site
to be updated. Also rewrote GetChannelUnread on top of the squirrel
builder so the same allow-list slice can be reused.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* go.mod: promote prometheus/common to direct after merge
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Use model.NewPointer for boards property permission field
Drops the local permNone variable in doSetupBoardsProperties and uses
model.NewPointer(model.PermissionLevelNone) inline, matching the
surrounding ContentFlagging/ManagedCategory code.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Extract saveViewT to share Views insert between Save and SaveBoardChannel
ViewStore.Save and SaveBoardChannel both built the same INSERT INTO
Views statement, so a future column addition would need updates in two
places. Extract the insert (plus PreSave/IsValid) into a private
saveViewT method that accepts any sqlxExecutor — the regular master
handle for ViewStore.Save, and the channel transaction for
SaveBoardChannel.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add IsMessageChannel helper on model.Channel
Mirrors IsBoard for the positive case: returns true for Open, Private,
Direct, and Group channel types. Lets future filtering code be
expressed against the allow-list rather than enumerating board types,
so newly introduced non-message channel types are excluded by default.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Move board input validation into Channel.IsValidBoard
CreateBoardChannel inlined four guards for type, team, and display
name. Move the type/team_id/display_name checks into a new
Channel.IsValidBoard method so the rules live with the model and
return the AppError directly. The TrimSpace on DisplayName stays at
the call site to match how CreateChannel sanitizes before validating.
Drops the now-unused app.channel.create_board_channel.{invalid_type,
no_team,no_display_name} translations and adds matching
model.channel.is_valid_board.* keys.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Extract buildBoardKanbanView from CreateBoardChannel
The kanban view construction (read status options, build columns,
serialize props, assemble *model.View) only depends on the status
property field and the creator id. Pulling it into its own helper
shrinks CreateBoardChannel and makes the column-building logic
testable in isolation.
Adds board_test.go with coverage for the empty-options error path,
the standard happy path, and the option-skipping branches.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Test Channel.IsValidBoard
Cover the four reject cases (wrong type, missing team_id, empty
display name) plus the open and private board accept cases.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* gofmt board_test.go
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Document POST /api/v4/boards in OpenAPI spec
* Add valid kanban props to api4 makeTestViewForAPI helper
* Assert kanban.ToProps error in makeTestViewForAPI helper
The helper used to swallow the error from kanban.ToProps. Take *testing.T
and require.NoError so a serialization failure surfaces immediately at the
call site instead of producing a malformed view.
* Run boards properties setup unconditionally
The feature-flag gate added in 6298e15e86 made the test suite impossible:
test infra applies FeatureFlags overrides only after app.NewServer returns,
but doAppMigrations runs during NewServer, so the flag was always false at
migration time. The migration short-circuited, the boards property group
was never registered, and every CreateBoardChannel test 500'd with
"boards property group not found."
Drop the gate. The migration is idempotent (keyed in System) and benign —
matches doSetupContentFlaggingProperties and doSetupManagedCategoryProperties.
IntegratedBoards still gates route registration (api4/board.go) and the
CreateBoardChannel runtime entry (app/board.go), so the property group sits
unused until the feature is enabled.
* Add Client4.CreateBoard and use it in tests
Adds boardsRoute() and CreateBoard(ctx, channel) on Client4 mirroring
CreateChannel/CreateView. Refactors api4 board tests off the raw
DoAPIPost("/boards", ...) calls and the SaveBoardChannel store
inserts that predated the API; both now exercise the public client
method, drop the makeTestBoardView helper and the manual SaveMember
follow-ups, and route through setupBoardTest so IntegratedBoards is
enabled where needed.
* make modules-tidy
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
97 lines
3.7 KiB
Makefile
97 lines
3.7 KiB
Makefile
ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
.PHONY: build build-v4 clean playbooks
|
|
|
|
V4_YAML = $(ROOT)/v4/html/static/mattermost-openapi-v4.yaml
|
|
|
|
V4_SRC = $(ROOT)/v4/source
|
|
PLAYBOOKS_SRC = $(ROOT)/playbooks
|
|
|
|
build: build-v4
|
|
|
|
build-v4: node_modules playbooks
|
|
@echo Building mattermost openapi yaml for v4
|
|
|
|
@if [ -r $(PLAYBOOKS_SRC)/merged-tags.yaml ]; then cat $(PLAYBOOKS_SRC)/merged-tags.yaml > $(V4_YAML); else cat $(V4_SRC)/introduction.yaml > $(V4_YAML); fi
|
|
@cat $(V4_SRC)/users.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/status.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/teams.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/channels.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/posts.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/preferences.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/files.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/recaps.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/uploads.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/jobs.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/system.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/emoji.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/webhooks.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/saml.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/compliance.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/ldap.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/groups.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/cluster.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/brand.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/commands.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/oauth.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/elasticsearch.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/dataretention.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/plugins.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/roles.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/schemes.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/service_terms.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/remoteclusters.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/sharedchannels.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/reactions.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/actions.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/bots.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/cloud.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/usage.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/permissions.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/imports.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/exports.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/ip_filters.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/bookmarks.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/boards.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/views.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/reports.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/limits.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/logs.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/outgoing_oauth_connections.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/metrics.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/scheduled_post.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/custom_profile_attributes.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/audit_logging.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/access_control.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/content_flagging.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/agents.yaml >> $(V4_YAML)
|
|
@cat $(V4_SRC)/properties.yaml >> $(V4_YAML)
|
|
@if [ -r $(PLAYBOOKS_SRC)/paths.yaml ]; then cat $(PLAYBOOKS_SRC)/paths.yaml >> $(V4_YAML); fi
|
|
@if [ -r $(PLAYBOOKS_SRC)/merged-definitions.yaml ]; then cat $(PLAYBOOKS_SRC)/merged-definitions.yaml >> $(V4_YAML); else cat $(V4_SRC)/definitions.yaml >> $(V4_YAML); fi
|
|
@echo Extracting code samples
|
|
cd server && go run . $(V4_YAML)
|
|
|
|
@node_modules/.bin/swagger-cli validate $(V4_YAML)
|
|
@cp ./v4/html/ssr_template.hbs ./v4/html/index.html
|
|
@echo Complete
|
|
|
|
node_modules: package.json $(wildcard package-lock.json)
|
|
@echo Getting dependencies using npm
|
|
|
|
npm install
|
|
touch $@
|
|
|
|
run:
|
|
@echo Starting local server
|
|
python3 -m http.server 8080 --directory ./v4/html
|
|
|
|
clean:
|
|
@echo Cleaning
|
|
|
|
rm -rf node_modules
|
|
|
|
playbooks:
|
|
@echo Fetching Playbooks OpenAPI spec
|
|
cd playbooks && node extract.js
|
|
cd playbooks && node merge-definitions.js $(V4_SRC)/definitions.yaml
|
|
cd playbooks && node merge-tags.js $(V4_SRC)/introduction.yaml
|