mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
master
11
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8feb24ea1f |
One name for this fork, and it is ours
The server module named github.com/hanzoai/team/server/v8 — a path that resolves to the retired workspace's repository, not this one — while server/public still published github.com/mattermost/mattermost/server/public. Both are github.com/hanzoteam/server/... now, which is where this code actually lives. That second half is what made the binary unbootable. Upstream's public path stayed claimed by upstream, mattermost-plugin-ai imported it, and the build linked public/model twice; public/plugin's gob.Register then ran twice under one name and panicked at init, before main. Reverting the rename traded the brand for a working binary. Rebranding the plugin alongside it needs no such trade: the agents fork is github.com/hanzoteam/agents/v2 against our public module, so no module named mattermost/mattermost is in the graph at all. Measured: `go list -deps ./cmd/mattermost` names exactly one public/model, and it is ours. |
||
|
|
8e84c8d5d6 |
The plugin API keeps the import path plugins import
Renaming server/public to github.com/hanzoai/team/server/public left the old
path unclaimed, and mattermost-plugin-ai still imports it — so the binary
linked public/model TWICE, ours and upstream's, and public/plugin's
gob.Register calls ran twice under one name:
panic: gob: registering duplicate types for "[]*model.SlackAttachment":
[]*model.MessageAttachment != []*model.SlackAttachment
at init, before main. The server has not been able to start since that rename
landed, which is why the deployment is still answering from an older build.
server/v8 keeps its new name; nothing outside this repo imports it. public
does not, because its path is not a brand — it is the plugin API, and every
plugin written against Mattermost imports it by that name. Our own agents
fork is proof: it carries a replace pointing that exact path back here.
Reverting the public half is what makes the two copies one again. Measured
after: `go list -deps ./cmd/mattermost` names exactly one public/model, the
binary starts, and it serves.
|
||
|
|
316dcf770f |
The module is ours, so its import path says so
Every package in this fork announced itself as github.com/mattermost/mattermost — in 4,553 import lines, in both go.mod module declarations, and in the workspace. A fork whose own import path names another company is one nobody can read as theirs, and it is the first thing anyone sees at the top of every file. server/v8 and server/public are now github.com/hanzoai/team/server/…, rewritten mechanically and verified: `go build ./...` is clean for both modules and `go vet` passes. Three things are deliberately UNTOUCHED, because they are other people's names rather than our branding: mattermost-plugin-ai and mattermost-plugin-mscalendar are real dependencies we consume, github.com/mattermost/msgpack is a real dependency, and the github.com/mattermost/mattermost/pull/… links in comments point at real upstream discussions that renaming would turn into dead links. server/public needs a `replace` to resolve locally now: the require still names a version, and no proxy serves our path. The workspace alone does not satisfy a require, which is exactly how this failed the first time. Co-authored-by: Hanzo Dev <[email protected]> |
||
|
|
3e85247df8 |
[MM-69055] Add rank property field type (#36809)
* Add rank property field type and migrate classification field to use it
Introduces a new 'rank' property field type that behaves identically to
'select' across validation, access-control masking, options handling, and
rendering. The classification markings admin panel now creates its
template, system, and channel fields as 'rank' instead of 'select', with
a paired DB migration to flip any existing classification rows.
* Enforce rank validation on ranked property field options
For PropertyFieldTypeRank fields, every option must carry a non-negative,
unique rank. Adds the Rank field to CustomProfileAttributesSelectOption
and strips stray Rank values from options on non-rank field types so
they cannot drift into persisted attrs.
* Materialize rank options in AttributeView and signal field updates to access control
Extend the AttributeView materialized view so rank-typed property values
are exposed as {"name", "rank"} objects, enabling downstream ABAC SQL and
CEL machinery to compare a user's rank against a named option without
baking rank integers into policy expressions.
Add OnPropertyFieldOptionsChanged on the access control service interface
and call it after every property field update so the service can drop any
per-field metadata it caches (such as the rank-by-name map) and invalidate
compiled-policy cache entries that reference the field.
* Show rank-and-lower options/values for shared_only rank fields
shared_only masking on a rank field previously required an exact option
match, the same as select/multiselect. For rank fields the intended
semantics are clearance-style: a caller sees every option and every
target value at or below their own rank.
filterSharedOnlyFieldOptions and filterSharedOnlyValue now branch rank
fields to filterSharedOnlyRankFieldOptions / filterSharedOnlyRankValue,
which compare against the caller's rank instead of intersecting option
IDs. Select, multiselect, and scalar (text/date/user) masking are
unchanged. A caller with no value of their own has no rank and sees
nothing; the source plugin still sees everything.
* Render rank property field type like select in webapp
Treat the new 'rank' custom profile attribute type as a single-select
everywhere it is editable, and make it fully usable from the system
console:
- user_settings/general: render rank fields as a single-select dropdown
(resolving option IDs to names) instead of a free-text input.
- system_user_detail: resolve rank option names and render the value
input as a native single-select.
- user_properties_type_menu: add a selectable "Rank" field type
(reusing the Select icon) so existing rank fields display correctly
and admins can create new rank fields from the UI.
- en.json: add the "Rank" type label string.
* Make rank cache invalidation cluster-aware and cover field deletion
OnPropertyFieldOptionsChanged previously dropped the access control
service's per-field rank cache only on the node handling the property
field update, so peer nodes kept serving stale name->rank maps until
restart. It was also wired into the update path only, leaving deleted
rank fields cached indefinitely.
Call OnPropertyFieldOptionsChanged from DeletePropertyField so a removed
rank field's cached options are dropped too. The access control service
now broadcasts the invalidation cluster-wide (see companion enterprise
change).
* Backfill option ranks when migrating classification fields to rank
The select->rank conversion previously only flipped the field type. On
upgrades the existing classification options carry no rank (master's
select option struct has no rank field, so the UI-sent rank was dropped
on save), which left an invalid rank field: the matview projected null
ranks, shared_only masking hid every value, and the validation hook
rejected any later edit.
Backfill a rank onto each option from its 1-based array position. The
classification UI keeps levels in severity order and rewrites the full
options array on every save, so position is the authoritative ordering;
1-based matches both the UI's `opt.rank ?? (i+1)` fallback and the
presets' ranks, so a configured preset is still recognized after upgrade.
The flip and backfill share one migration (one transaction), so the field
is never observable in the invalid (rank, null-rank) state, and the down
migration strips the rank key to restore the prior select shape.
Only the three known classification fields with a non-empty options array
are touched; the updates match at most three rows and add no meaningful
lock footprint.
* Add System Console UI for ranked property fields
Implements the admin UI for the ranked property field type across three
System Console surfaces:
- User Attributes: the "Ranked" attribute type, numbered value chips in
ascending rank order, a per-chip popover (rename / change rank / remove),
and an "Edit ranking" modal with drag-reorder, arrow steppers, numeric
rank inputs, auto-assigned next rank, and inline duplicate rejection.
- Membership Policy editor: ranked comparison operators (is exactly,
is not, is at least, is greater than, is at most, is less than) shown for
ranked attributes in place of the standard set, with CEL build/parse and
default-operator wiring.
- User detail: a ranked-value picker rendering options highest-rank-first
with numbered badges and a checkmark on the assigned value.
Adds Playwright e2e coverage for all three surfaces (plus page-object
helpers) and webapp unit tests for the operator wiring and rank utilities.
* Fix enterprise CI: regenerate access-control mocks and add rank i18n key
The enterprise CI lane fails on two pre-existing backend gaps on this
branch:
- go vet (check-style): OnPropertyFieldOptionsChanged was added to
PolicyAdministrationPointInterface but the generated einterfaces mocks
were never regenerated, so AccessControlServiceInterface /
PolicyAdministrationPointInterface mocks no longer satisfy the
interface (access_control_test.go, access_control_masking_test.go).
Add the missing method to both mocks.
- Check i18n: enterprise access_control/administration.go references the
app.pap.rehydrate_rank.app_error key, which was never added to
server/i18n/en.json. Add it so `make i18n-extract` produces a clean
diff.
Verified: both affected test packages compile, `make i18n-extract`
yields no diff, and `make i18n-check` passes.
* Retrigger enterprise CI
Pick up enterprise fix 15914c11 (require.NoError in rank cel_utils tests)
in the combined Enterprise CI/tests lane, which pins the enterprise SHA at
mattermost-side dispatch time.
* Retrigger enterprise CI
Pick up enterprise fix 48db14db (golangci-lint findings in rank
access-control code) in the combined Enterprise CI/tests lane.
* Clamp shared_only rank values to the caller's rank instead of hiding
For a shared_only rank field, filterSharedOnlyRankValue previously hid a
target's value entirely when the target outranked the caller, returning
nil. That answered "is the target at or below me?" but not the question
the field exists for: "what can we talk about, and at what level?" A
higher-ranked target simply disappeared.
Now the value is clamped to the highest rank the caller shares with the
target — the target's own value when it is at or below the caller's rank,
otherwise the option at the caller's own rank. The caller always learns
their shared ceiling and never sees a rank above their own. Ranks are
unique per field, so the clamp target is unambiguous.
* Renumber rank migrations to 194-197 (after property_groups 193)
000193_add_property_groups_schema_version was already on master, so
our rank migrations should follow it: 194-197.
* Fix e2e classification helper field names after rename migration
Migration 000196 renamed channel_classification → classification and
system_classification → classification. Update the e2e helpers to
create and clean up fields with the new canonical names so the frontend
(which looks for 'classification') can find them.
* Remove unused i18n key and fix e2e prettier formatting
app.pap.save_policy.advanced_expression_blocked was added to en.json
but never used as an AppError key in Go code — remove it so i18n-check
passes. Also fix prettier formatting in ranked_operators.spec.ts.
* Fix 000194 down migration: drop AttributeView before enum rebuild
TestUpAndDownMigrations/Should_be_reversible_for_postgres failed because
the down migration rebuilds the property_field_type enum (Postgres can't
drop an enum value in place), which requires ALTER COLUMN on
PropertyFields.Type. The AttributeView materialized view reads that
column, so Postgres rejects the alter: "cannot alter type of a column
used by a view or rule".
The up path is unaffected because it uses ADD VALUE (no column rewrite);
only the down rebuild trips the dependency. Mirror the canonical
drop-view / alter-column / recreate-view pattern: drop AttributeView,
rebuild the enum, then recreate the no-rank view (the same definition
000197's down restores, which 000177's down later replaces).
Verified end-to-end against PostgreSQL 16: full up-then-down sequence
now passes.
* Add unit tests for rank validation and field-change signalling
Fills two gaps flagged by PR test analysis:
- access_control_attribute_validation_test.go: rank option validation
(valid ranks persist; missing/negative/duplicate rank rejected; zero
rank allowed; non-rank fields strip stray rank values).
- property_field_test.go: UpdatePropertyFields/DeletePropertyField
signal the access control service via OnPropertyFieldOptionsChanged
for each affected field, and stay nil-safe when no AC service exists.
* Add api4 tests for rank-field permission branching
Fills the API gap flagged by PR test analysis: rank fields participate
in the isOptionsOnly permission branch alongside select/multiselect.
- properties_test.go: an options-only PATCH on a rank field uses the
narrower manage-options permission (member succeeds), while a
structural PATCH (name change) requires the full edit-field
permission (member forbidden, admin succeeds).
- custom_profile_attributes_test.go: an options-only PATCH on a rank
CPA field routes through the options path and round-trips ranks.
* Add mmctl unit tests for rank attribute resolution
Fills the mmctl gap flagged by PR test analysis. Both resolution
directions for rank-typed attributes were untested:
- user_attributes_test.go (TestResolveDisplayValue): a stored rank
option ID resolves to its option name for display; unknown IDs and
option-less fields fall back to the raw value.
- user_attributes_value_test.go (TestResolveOptionNamesToIDs): setting
a rank value by option name resolves to the option ID; already-an-ID
and unknown names pass through.
* Refine ranked attribute editing UI
Edit ranking modal:
- Derive ranks from row position so reordering or removing a value always
keeps them contiguous (1..N) with no gaps or duplicates
- Drop the arrow steppers in favor of drag-only reordering; render the drag
clone through a body portal so it isn't offset by the modal dialog transform
- Show values as read-only chips (lowest-first) with Lowest/Highest labels
- "Add value" toggles into an inline row (fake handle + borderless field);
Enter commits the value instead of closing the modal
- Title shows the field name plus "Ranked attribute"
Inline rank values:
- Rank badge fills the left of the chip; add an inline remove (X) that reuses
react-select's CrossIcon so it matches select fields
Also give the rank attribute type its own SortAscendingIcon and trim a couple
of stale comments.
* Fix SCSS property order lint errors
* Fix e2e rank modal tests to match drag-and-drop UX
The ranked schema modal uses position-based ranks (drag to reorder) — there
are no editable numeric rank inputs per row and no per-row name inputs. The
two failing tests were written against an earlier design that had those inputs:
- "rejects a duplicate rank inline" expected .ranked-schema-modal__rank-input
and .ranked-schema-modal__error (neither exists). Replaced with a test that
covers the actual duplicate-label guard on the add-value inline input.
- "adds a value via the Edit ranking modal" expected .ranked-schema-modal__name-input
(doesn't exist) and that save is disabled while the add input is open (it
isn't — save is disabled only when rows is empty). Updated to use the real
add-value flow: click "Add value", fill .ranked-schema-modal__add-input, blur
to commit.
Also removes the three broken page-object helpers (rankedModalRankInputs,
rankedModalError, rankedModalNameInputs) whose CSS selectors never existed.
* Enforce positive ranks and backfill them on select-to-rank conversion
Rank values must be positive integers (>= 1), matching the webapp's
isValidRank helper and rankForIndex which both require rank >= 1. The
server was accepting rank = 0 (rank < 0 check), allowing invalid data
that would cause filtering bugs: a caller with a rank-0 option would
see nothing in a shared-only field since no option would satisfy
rank <= 0. Change the guard to rank <= 0 and update the error message
and tests accordingly.
When converting a field from select/multiselect to rank via the type
dropdown, the existing options had no ranks. The server's option
validation then rejected the save (or the UI showed stale local state
appearing valid). Auto-assign contiguous 1-based ranks in array order
at the point of type change so the conversion is immediately valid and
the user does not need to open the rank-ordering modal just to commit.
* Show an inline error when a ranked option is renamed to a duplicate
Renaming a ranked option to a name already used by another option was
silently ignored: the draft reverted with no feedback, leaving the user
unsure why their edit didn't stick. The add-value flow already warns on
duplicates; the rename path now matches it.
The chip popover surfaces "Values must be unique." beneath the label
input while the typed name collides, and the rename stays blocked so a
duplicate is never committed.
* Scroll the ranked schema list so the modal footer stays in view
A ranked attribute with many values (e.g. 30) grew the edit modal taller
than the viewport, pushing the Save/Cancel footer off the bottom of the
screen where it couldn't be reached.
Cap the value list at 50vh and scroll it internally, keeping the header
and footer anchored. The list is the droppable's own scroll container, so
react-beautiful-dnd auto-scrolls it while a row is being dragged, and a
small right padding keeps the scrollbar clear of the remove buttons.
* Add a shared allow-list for option-bearing property field types
The "is this a select/multiselect/rank field?" check was open-coded as a
three-way type-negation chain in the model, both PSAv2 patch handlers, and
the access-control shared-options filter. Each copy had to be kept in sync
by hand as field types were added.
Introduce an optionFieldTypes allow-list in the model with a
PropertyFieldType.SupportsOptions() helper (mirroring the webapp's
supportsOptions) and route every call site through it, so adding a future
option-bearing type is a one-line change.
* Guard the rank options filter before its store lookup
filterSharedOnlyRankFieldOptions built the option-rank map and ran the
caller-rank store lookup before checking whether the field had a usable
options array at all. A field with no options (or a malformed attrs blob)
has nothing to filter, yet still paid for a database query.
Move the cheap nil/shape guards to the top so an optionless field returns
immediately, and reuse the extracted options slice in the filter loop
instead of pulling it out of attrs a second time.
* Memoize the ranked attribute editors' event handlers
The rank schema modal and the inline rank-values cell recreated every
handler (drag-end, move, remove, confirm, rename, add) on each render.
These are passed down to the modal footer, the drag-and-drop context, and
per-chip popovers, so the fresh identities defeated memoization downstream.
Wrap them in useCallback with explicit dependencies. No behavior change.
* Add tests for the classification select-to-rank migration
The 000195 conversion is non-trivial: it flips specific (Name, ObjectType)
fields in the access_control group from select to rank, then backfills a
1-based rank onto each option from its array position, guarding against
empty or absent options arrays.
Cover the behavior end to end against a real Postgres schema: the type
flip with position-derived ranks in order, the empty- and absent-options
guards (type flips without fabricating options), the name/object-type/group
mismatches that must stay select, and the down round-trip that strips the
ranks and reverts the type.
* Gate the rank property field type behind a feature flag
Add a PropertyFieldRank feature flag (off by default) that gates the
"rank" custom profile attribute type.
The enforcement is a single app-layer gate, rankPropertyFieldGate, shared
by both CreatePropertyField (blocks creating a rank field) and
UpdatePropertyFields (blocks converting an existing field to rank). When
the flag is off it returns app.property_field.rank_disabled.app_error.
The admin console CPA type menu hides the rank option unless the flag is
on, read via useGetFeatureFlagValue.
Existing app/api4 tests that exercise rank fields now enable the flag in
their setup so they continue to pass.
* Scope the rank feature-flag gate to user-object fields
The PropertyFieldRank gate rejected any rank-typed field create/update
when the flag was off. But classification markings now uses the rank
type internally (template/system/channel object types) and ships GA
behind the separate ClassificationMarkings flag, which is on by default
while PropertyFieldRank is off by default. The migration also converts
existing classification fields to rank unconditionally. Together this
broke the classification admin panel in the default configuration: both
creating new classification fields and editing existing (migrated) ones
returned app.property_field.rank_disabled.app_error.
Scope the gate to ObjectType == user, which is the only origin of the
user-facing rank CPA type (createCPAField forces ObjectType=user). Rank
fields on other object types are exempt, so classification keeps working
regardless of the flag while the user-facing CPA rank type stays gated.
Add regression cases proving a non-user (classification-style) rank
field is creatable and convertible-to with the flag off, and enable
PropertyFieldRank in the e2e default config so the user-facing rank
specs pass.
* Update webapp/channels/src/components/admin_console/system_properties/rank_badge.scss
Co-authored-by: abhijit-singh <[email protected]>
* Enable the rank feature flag in the e2e CI server env
The new rank e2e tests failed in playwright-full because the CI docker
server gets feature flags from MM_FEATUREFLAGS_* env vars (config patches
don't stick without a SplitKey), and PropertyFieldRank was only set in the
local default_config.ts. Add the matching env var so the flag is on in CI.
* Fix stale migration-number references in classification rank down migrations
The 000195 and 000196 down migrations carried comment references to their
development-era numbers (000191/000192). Correct them to the current numbering
(000195 reverses itself; 000196's down restores distinct names before 000195's
down matches on them). Addresses review feedback from @mgdelacroix.
* Use PropertyFieldType.SupportsOptions() for option-field type checks
Replace the repeated `Select || Multiselect || Rank` comparisons with the
existing SupportsOptions() helper across the access-control masking, validation,
and option-filtering paths, and in mmctl value resolution. Behavior is unchanged
(SupportsOptions covers exactly those three types). Addresses review feedback
from @mgdelacroix.
* webapp: use supportsOptions() helper for option-field type checks
Replace the repeated `type === 'select' || 'multiselect' || 'rank'` checks with
the existing supportsOptions() helper from @mattermost/types/properties, matching
the server-side SupportsOptions() usage. Addresses review feedback from @mgdelacroix.
* Include rank in extractOptionIDsFromValue error message
The function handles select, multiselect and rank, but the error message only
listed select and multiselect. Addresses review feedback from @mgdelacroix.
* Validate option rank in CustomProfileAttributesSelectOption.IsValid
When an option carries a rank, enforce that it is a positive integer at the
model layer, mirroring the field-level option validation. Rank stays optional
so select/multiselect options (which carry none) remain valid. Addresses review
feedback from @mgdelacroix.
* Invalidate access-control cache before broadcasting field update
In UpdatePropertyFields, move the OnPropertyFieldOptionsChanged notification
above the websocket broadcast so a client reacting to the update event never
re-reads stale cached field metadata. This matches the ordering already used in
DeletePropertyField. Addresses review feedback from @mgdelacroix.
* Assert stored options in options-only patch permission tests
The select/multiselect/rank options-only update tests only checked that the
request succeeded; also assert the returned field's options (id, name, and rank
for the rank case) so the tests actually verify the change was persisted.
Addresses review feedback from @mgdelacroix.
* Add FeatureFlagPropertyFieldRank to webapp ClientConfig type
The server-side PropertyFieldRank feature flag and user_properties_type_menu.test.tsx
reference FeatureFlagPropertyFieldRank, but it was never added to the webapp
ClientConfig FeatureFlags type, leaving tsc -b red. Add the missing field.
* Tighten the ranked option popover spacing
Drop MUI's default 8px MuiList top/bottom padding on the per-option popover and
reduce the label input's bottom padding to 4px, so the popover reads tighter
without jamming the label input against the top edge. Addresses design feedback
from @abhijit-singh.
* Add header and footer dividers to the Edit ranking modal
Enable GenericModal's bodyDivider and footerDivider so the ranked schema modal
shows a divider under the header and above the Save/Cancel footer, which also
delineates the scroll area when the value list is long. Addresses design
feedback from @abhijit-singh.
* Match ranked 'Add values…' affordance to select/multiselect
The ranked values cell now mirrors the select/multiselect CreatableSelect
cell for consistency across field types:
- Tab commits a pending value (keeping focus in the input for the next
one) when it's non-empty and not a duplicate, matching the select cell;
a blank/duplicate input lets Tab move focus away normally.
- The empty-state placeholder uses the shared 'Add values… (required)'
text and matches react-select's placeholder color (full-opacity
neutral50) and 10px content inset, so size, color, and left alignment
line up with the select cell.
- The placeholder is hidden once values exist, mirroring react-select.
- The chips well gets the same hover/focus background tint and text
cursor as the select control.
* Auto-size the ranked 'Add values…' input like react-select
The bare <input> scrolled its overflow in a fixed-width box, while the
select/multiselect cell grows its input and wraps to a new row as you
type. Replicate react-select's sizer technique: wrap the input in an
inline-grid whose hidden ::after mirrors the live text (content:
attr(data-value), white-space: pre, font: inherit) and sizes the grid
column the input fills. The input now grows with its content and, as a
flex child of the values well, wraps to a new row when it no longer fits.
Both the input and the sizer use 'font: inherit' (matching react-select)
so the measured and rendered text line up and the font matches the select
cell. Since the auto-sized input no longer spans the whole cell, a
mousedown handler on the well forwards focus to the input, mirroring
react-select's clickable control.
* Fix consistent-type-imports lint errors in Playwright e2e specs
* Enable PropertyFieldRank feature flag in rank e2e test setup
The Rank type option in the attribute type menu is gated behind the
PropertyFieldRank feature flag. initSetup resets config, so the flag
must be explicitly re-enabled before the test exercises the UI selector.
* Remove broken feature-flag patchConfig from rank e2e setup
setupTest called patchConfig({FeatureFlags: {PropertyFieldRank: 'true'}})
with the string 'true'. PropertyFieldRank is a Go bool, so the server's
patchConfig handler (which does json.Decode(&cfg) into *model.Config before
any filtering) failed to unmarshal the string into a bool and returned 400
"Invalid or missing config in request body." This hard-failed setupTest and
all four specs (CI run 27387310039: 4/4 failed at spec line 36).
The call was both broken and unnecessary:
- Without a SplitKey the config store marks FeatureFlags read-only
(PlatformService.SetupFeatureFlags -> SetReadOnlyFF(!splitConfigured)), so
no patchConfig can toggle a flag. The flag is enabled at the server level:
the MM_FEATUREFLAGS_PROPERTYFIELDRANK env var in CI (added to
e2e-tests/.ci/server.generate.sh) and the server config locally.
- With the env var in place, all four specs passed at commit 8fca57bf3b; the
later commit that added this line is what regressed them.
Remove the call and document where the flag actually comes from.
* Locate ranked add-value input by class, not placeholder
The "creates a ranked attribute" spec timed out at addRankValuesToLast
waiting for getByPlaceholder('Add value…') on the inline add-value input.
Commit 3c12f30008 ("Match ranked 'Add values…' affordance to
select/multiselect") changed that input in two ways the page object never
caught up with:
- the placeholder text became 'Add values… (required)' (plural, suffixed),
so 'Add value…' no longer matches; and
- the placeholder now renders only in the empty state
(placeholder={showPlaceholder ? ... : undefined}), so it disappears after
the first value is added — a placeholder lookup can never add 3 values.
Locate the input by its stable class .user-property-rank-values__add-input
instead, which is present regardless of options count or placeholder text.
This is the real failure the reverted patchConfig change had misdiagnosed as
a feature-flag issue. The spec passed at 8fca57bf3b because that predates
3c12f30008 (placeholder was then 'Add value…' and always shown).
* Empty commit to retrigger CI after enterprise branch update
Co-authored-by: Maria A Nunez <[email protected]>
* Fix migration test after renumbering 000194 to 000198
During conflict resolution, migration 000194_add_type_id_index_to_access_control_policies
was renumbered to 000198 to maintain sequential ordering after the new rank migrations.
This commit updates the corresponding test file to match:
- Renamed migration_000194_test.go to migration_000198_test.go
- Updated test function name from TestMigration000194 to TestMigration000198
- Updated migration file references to point to 000198 instead of 000194
Co-authored-by: Maria A Nunez <[email protected]>
* Renumber migrations: restore 000194 from master, move rank migrations to 000196-000199
The 000194_add_type_id_index_to_access_control_policies migration came from master and should keep its original number. Our rank migrations have been renumbered:
- 000194 -> 000196: add_rank_to_property_field_type
- 000195 -> 000197: convert_classification_fields_to_rank
- 000196 -> 000198: rename_classification_linked_fields
- 000197 -> 000199: add_rank_to_attribute_view
This leaves 000195 available for the threadmemberships_cleanup_v2 migration from master.
Co-authored-by: Maria A Nunez <[email protected]>
* Rename migration test files to match renumbered migrations
After renumbering rank migrations from 000194-000197 to 000196-000199, the test file migration_000195_test.go (which tests the classification->rank conversion) needed to be renamed to migration_000197_test.go to match the new migration number. Updated the test function name and migration file references accordingly.
Co-authored-by: Maria A Nunez <[email protected]>
* Filter policy field autocomplete to user-type fields only
Add ObjectType: user filter to GetAccessControlFieldsAutocomplete so
the attribute picker in the Membership Policies editor no longer
surfaces template, system, and channel classification-marking fields
as ghost entries alongside real user CPAs.
MM-69366
---------
Co-authored-by: abhijit-singh <[email protected]>
Co-authored-by: Maria A Nunez <[email protected]>
Co-authored-by: Mattermost Build <[email protected]>
Co-authored-by: Hanzo Dev <[email protected]>
|
||
|
|
228112507a |
Mm 68846 masking from visual to canonical walker (#36772)
* MM-68846 - add canonical CEL AST masking walker and model resolver interface * add canonical masking methods to PAP einterface and update mock * Migrate app-layer masking to canonical CEL AST walker * Remove Visual AST masking dead code and obsolete i18n key * Update simulation masking tests to mock MaskExpressionForCaller * reject persisted tokens and enforce merge shape match and add corresponding tests * MM-68900 - abac masking add e2e back * add missing config values and split the tests * implement coderabbit feedback * adjust timeout and disable button logic * enhance masking logic and tests for access control policies * refactor masking tests and database setup for improved field deletion handling * Enhance error handling in TestMergeStoredPolicyExpressions to verify error ID and status code * Refactor error handling in access control policy methods for clarity * Refactor masking logic and improve clarity in access control methods * Allow deny-all 'false' policies by dropping the redundant sentinel check in rejectMaskedTokens; add tests * Add masking-related error messages and update test descriptions with tags * Add error handling for uninitialized Policy Administration Point in access control |
||
|
|
db4b79d1f6 | fix the mocks and the store layer (#37049) | ||
|
|
de4bcf9c66 |
MM - 69063 - team abac backend and security gate (#36903)
* MM-69063 - Add team ABAC model and constants foundation * Add team ABAC store EXISTS, channel Type retrofit, policy count split, and index migration * Add team ABAC app layer: access gate, hydrators, assign/unassign, cleanup, and GetTeamMembersToRemove store * Enforce team membership ABAC on join and hide policy governed teams from non-qualifying users in the directory * Add team_ids to access policy assign/unassign, expose per-team policy GET, and support abac_match_only for not_in_team user listing * Add team ABAC client methods, websocket handler, per-team System Console policy UI, and hide policy-governed teams from non-qualifying users * Make team ABAC mode-aware: advisory on public teams, strict on private, and surface governed private teams to qualifying users in directory listings * Flag-gate team ABAC mutation/read APIs and fix policy-save error handling, member-removal limit, team-id validation, export, and audit cleanup * coderabbit feedback; Broadcast team policy enforcement updates on policy create/update and activation, not only on delete * Update team access control policy schema to allow nullable policies and enhance test cases with channel counts * Enhance access control policy tests to include team policy search alongside channel policy search * Add team membership access control feature flag to docker-compose generation * Implement team access control policy checks and refactor related components * Audit-log team ABAC policy removal on team archive and delete --------- Co-authored-by: Mattermost Build <[email protected]> |
||
|
|
e6ae3c9160 | [MM-68693] Resource level permission policies and new simulation (#36472) | ||
|
|
430513dfe9 | implement property field seatch within access control policies (#35494) | ||
|
|
0d847ef67c |
Upgrade Go to 1.24.3 (#31220)
* Upgrade Go to 1.24.3 Updates the following files: - server/.go-version: 1.23.9 → 1.24.3 - server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye - server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 - server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking: - Added response() helper function in slashcommands/util.go for simple string responses - Removed unused responsef() function from slashcommands/util.go - Replaced responsef() with response() for translated strings that don't need formatting - Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation - Updated marketplace buildURL to handle format strings conditionally * Update generated mocks for Go 1.24.3 Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3. This addresses mock generation failures that occurred with the Go upgrade. * Update to bookworm and fix non-existent sha Signed-off-by: Stavros Foteinopoulos <[email protected]> * fix non-constant format string --------- Signed-off-by: Stavros Foteinopoulos <[email protected]> Co-authored-by: Stavros Foteinopoulos <[email protected]> Co-authored-by: Hanzo Dev <[email protected]> |
||
|
|
4a5e5b4d87 |
[MM-61756] Attribute Based Access Control - Phase 1 (#30785)
Attribute Based Access Control - Base * MM-63662 * MM-63919 * MM-63954 * MM-63955 * MM-63425 * MM-63426 * MM-63458 * MM-63459 * MM-63603 * MM-63845 * MM-64146 * MM-64199 * MM-64201 * MM-64233 * MM-64247 * MM-64268 --------- Co-authored-by: Harshil Sharma <[email protected]> Co-authored-by: Pablo Andrés Vélez Vidal <[email protected]> Co-authored-by: abhijit-singh <[email protected]> Co-authored-by: Harrison Healey <[email protected]> |