FreeNAS/freenas da4c4fftests/api2 test_cloud_backup.py

add test cases
DeltaFile
+18-4tests/api2/test_cloud_backup.py
+18-41 files

FreeNAS/freenas 80f02c5tests/api2 test_smb_share_path_acl.py

Fix
DeltaFile
+2-2tests/api2/test_smb_share_path_acl.py
+2-21 files

FreeNAS/freenas 03a6fa0tests/api2 test_261_iscsi_cmd.py test_300_nfs.py

Remove tests
DeltaFile
+0-3,324tests/api2/test_261_iscsi_cmd.py
+0-2,063tests/api2/test_300_nfs.py
+0-1,619tests/api2/test_nvmet_tcp.py
+0-1,404tests/api2/test_200_ftp.py
+0-1,053tests/api2/test_fibre_channel.py
+0-936tests/api2/test_345_acl_nfs4.py
+0-10,399248 files not shown
+0-37,702254 files

FreeNAS/freenas 2ecd60csrc/middlewared/middlewared/plugins smb.py, tests/api2 test_smb_share_path_acl.py

Fix validation for SMB share paths that are dirs

This commit fixes over-strict validation of ZFS properties for
child datasets of SMB shares. If the dataset mountpoint isn't a
child path of the share path then we don't need to check its
properties.
DeltaFile
+48-0tests/api2/test_smb_share_path_acl.py
+11-1src/middlewared/middlewared/plugins/smb.py
+59-12 files

FreeNAS/freenas 7ec78e4src/middlewared/middlewared/api/v25_10_0 webshare.py, src/middlewared/middlewared/plugins webshare.py

NAS-XXXXX: Fix flake8 issues in WebShare configuration

- Fix line length issues in API schema docstrings
- Remove trailing whitespace and blank line issues
- Improve code formatting for better readability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+12-7src/middlewared/middlewared/api/v25_10_0/webshare.py
+4-4src/middlewared/middlewared/plugins/webshare.py
+16-112 files

FreeNAS/freenas 68ac442src/middlewared/middlewared/alembic/versions/25.10 2025-06-24_15-00_add_webshare_complete.py, src/middlewared/middlewared/api/v25_10_0 webshare.py

NAS-XXXXX: Add PAM service name and allowed groups to WebShare config

- Add pam_service_name field (read-only, hardcoded to 'webshare')
- Add allowed_groups field with API support and validation
- Update database model with new srv_pam_service_name and srv_allowed_groups columns
- Add validation to ensure groups exist on the system
- Update configuration file generation to include new fields
- Set default allowed_groups to ['webshare'] when empty
- Update alembic migration to include new fields in initial setup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+53-0src/middlewared/middlewared/plugins/webshare.py
+8-2src/middlewared/middlewared/alembic/versions/25.10/2025-06-24_15-00_add_webshare_complete.py
+5-0src/middlewared/middlewared/api/v25_10_0/webshare.py
+66-23 files

FreeNAS/freenas 2e17f5dsrc/middlewared/middlewared/plugins/pool_ dataset_query_utils.py

NAS-136511 / 25.10 / Fix `dataset_query_utils.build_set_of_zfs_props` (#16688)

DeltaFile
+2-2src/middlewared/middlewared/plugins/pool_/dataset_query_utils.py
+2-21 files

FreeNAS/freenas 49f4437src/middlewared/middlewared/plugins/pool_ dataset_query_utils.py

fix build_set_of_zfs_props
DeltaFile
+2-2src/middlewared/middlewared/plugins/pool_/dataset_query_utils.py
+2-21 files

FreeNAS/freenas a870dd5tests/api2 test_cloud_backup.py

add test case
DeltaFile
+7-3tests/api2/test_cloud_backup.py
+7-31 files

FreeNAS/freenas 4a1525asrc/middlewared/middlewared/alembic/versions/25.10 2025-06-24_15-00_add_webshare_complete.py, src/middlewared/middlewared/plugins auth.py account.py

Remove webshare user property from middleware

- Remove bsdusr_webshare column from user model
- Update alembic migration to exclude webshare user column
- Remove webshare authentication logic from auth service

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+6-16src/middlewared/middlewared/alembic/versions/25.10/2025-06-24_15-00_add_webshare_complete.py
+0-13src/middlewared/middlewared/plugins/auth.py
+0-1src/middlewared/middlewared/plugins/account.py
+6-303 files

FreeNAS/freenas 83d835esrc/middlewared/middlewared/api/v25_10_0 zfs_resource_crud.py __init__.py, src/middlewared/middlewared/plugins/zfs resource_crud.py __init__.py

WIP (work on query API endpoint)
DeltaFile
+317-0src/middlewared/middlewared/api/v25_10_0/zfs_resource_crud.py
+36-0src/middlewared/middlewared/plugins/zfs/resource_crud.py
+1-0src/middlewared/middlewared/api/v25_10_0/__init__.py
+0-0src/middlewared/middlewared/plugins/zfs/__init__.py
+354-04 files

FreeNAS/freenas 0034544src/middlewared/middlewared/alembic/versions/25.10 2025-07-01_17-20_truecloud_ratelimit.py

migration
DeltaFile
+32-0src/middlewared/middlewared/alembic/versions/25.10/2025-07-01_17-20_truecloud_ratelimit.py
+32-01 files

FreeNAS/freenas 53ac815src/middlewared/middlewared/api/v25_10_0 cloud_backup.py, src/middlewared/middlewared/plugins/cloud_backup restore.py sync.py

at rate_limit to TrueCloud tasks
DeltaFile
+11-2src/middlewared/middlewared/api/v25_10_0/cloud_backup.py
+2-2src/middlewared/middlewared/plugins/cloud_backup/restore.py
+2-2src/middlewared/middlewared/plugins/cloud_backup/sync.py
+1-0src/middlewared/middlewared/plugins/cloud_backup/crud.py
+16-64 files

FreeNAS/freenas 85599f0src/middlewared/middlewared/plugins/zfs normalization.py, tests/unit test_zfs_asdict_normliazation.py

add normalization file and tests
DeltaFile
+371-0tests/unit/test_zfs_asdict_normliazation.py
+110-0src/middlewared/middlewared/plugins/zfs/normalization.py
+481-02 files

FreeNAS/freenas a04d50fsrc/middlewared/middlewared/api/v25_10_0 cloud_backup.py, src/middlewared/middlewared/plugins/cloud_backup sync.py restore.py

add rate_limit to `cloud_backup.sync` and `cloud_backup.restore`
DeltaFile
+5-3src/middlewared/middlewared/plugins/cloud_backup/sync.py
+4-0src/middlewared/middlewared/api/v25_10_0/cloud_backup.py
+2-0src/middlewared/middlewared/plugins/cloud_backup/restore.py
+11-33 files

FreeNAS/freenas 1670d6bsrc/middlewared/middlewared/api/base/types string.py, src/middlewared/middlewared/api/v25_10_0 cloud.py cloud_backup.py

doc
DeltaFile
+5-5src/middlewared/middlewared/api/v25_10_0/cloud.py
+0-3src/middlewared/middlewared/api/v25_10_0/cloud_backup.py
+3-0src/middlewared/middlewared/api/v25_10_0/cloud_sync.py
+1-1src/middlewared/middlewared/api/base/types/string.py
+9-94 files

FreeNAS/freenas 2356ee4src/middlewared/middlewared/plugins/zfs property_management.py, tests/unit test_property_management.py

add files for building zfs properties
DeltaFile
+523-0tests/unit/test_property_management.py
+166-0src/middlewared/middlewared/plugins/zfs/property_management.py
+689-02 files

FreeNAS/freenas b0542a7src/middlewared/middlewared/plugins/apps schema_construction_utils.py, src/middlewared/middlewared/pytest/unit/plugins/apps test_schema_immutable_fields.py test_schema_construction_utils.py

Handle edge case where immutable inside lists was not working properly
DeltaFile
+1,549-0src/middlewared/middlewared/pytest/unit/plugins/apps/test_schema_immutable_fields.py
+63-5src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+66-0src/middlewared/middlewared/pytest/unit/plugins/apps/test_schema_construction_utils.py
+1,678-53 files

FreeNAS/freenas 9a72da0src/middlewared/middlewared/plugins/apps schema_construction_utils.py, src/middlewared/middlewared/pytest/unit/plugins/apps test_construct_schema.py test_normalize_and_validate.py

Fix app creation with empty values by populating defaults

When creating apps with empty values {}, the schema validation was using
exclude_unset=True which prevented defaults from being populated. This
caused template rendering to fail when accessing fields like run_as.user.

Changed construct_schema to use exclude_unset=False so defaults are properly
populated for fields not provided by the user.

- Updated validate_model call to exclude_unset=False in construct_schema
- Added test to verify defaults are populated with empty input
- Updated test_normalize_and_validate to use actual validation logic
DeltaFile
+66-1src/middlewared/middlewared/pytest/unit/plugins/apps/test_construct_schema.py
+16-4src/middlewared/middlewared/pytest/unit/plugins/apps/test_normalize_and_validate.py
+2-1src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+84-63 files

FreeNAS/freenas cd06bf9src/middlewared/middlewared/plugins/apps schema_construction_utils.py, src/middlewared/middlewared/pytest/unit/plugins/apps test_nested_show_if.py

Fix nested show_if inheritance for dict fields

When a parent dict field is hidden by a show_if condition, its required
nested fields should not trigger validation errors. This fix propagates
the visibility state from parent dict fields to their children during
Pydantic model generation.

The implementation:
- Adds parent_hidden parameter to generate_pydantic_model to track visibility
- Evaluates show_if conditions for dict fields and propagates hidden state
- Marks all fields as NotRequired when their parent dict is hidden
- Preserves existing show_if behavior for non-nested cases

This resolves the issue where required fields inside hidden dict
structures (e.g., storage.data.host_path_config.path) would still
cause validation errors even when their parent was hidden by show_if.
DeltaFile
+260-0src/middlewared/middlewared/pytest/unit/plugins/apps/test_nested_show_if.py
+27-10src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+287-102 files

FreeNAS/freenas 06c99ffsrc/middlewared/middlewared/plugins/apps schema_construction_utils.py, src/middlewared/middlewared/pytest/unit/plugins/apps test_schema_construction_utils.py

Revert "Fix dict/list required/non-required issue"

This reverts commit 2217062dd210d19a21d7011f4b518098addba5f3.

The original behavior where non-required lists and dicts automatically get
empty defaults ([] and {}) was the intended behavior for backward compatibility
with existing app configurations.

This commit restores:
- default_factory assignment for nested dicts in process_schema_field
- default_factory set to list/dict for non-required lists/dicts in create_field_info_from_schema
- Test expectations that non-required lists/dicts get empty defaults

The behavior ensures that:
- Non-required lists without explicit defaults get []
- Non-required dicts without explicit defaults get {}
- Nested dicts with default values on all subfields get instantiated with those defaults
DeltaFile
+20-257src/middlewared/middlewared/pytest/unit/plugins/apps/test_schema_construction_utils.py
+9-1src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+29-2582 files

FreeNAS/freenas a7f993bsrc/middlewared/middlewared/plugins/apps pydantic_utils.py schema_construction_utils.py, src/middlewared/middlewared/pytest/unit/plugins/apps test_schema_construction_utils.py

Add string length validation for hostpath schema types

- Add create_length_validated_hostpath function to apply min/max length validation before path conversion
- Update schema construction to use length-validated hostpath when constraints are specified
- Add comprehensive tests for path and hostpath types with length constraints
- Fix test expectations to properly validate empty strings against length constraints
- Update test assertions for path type to expect 'items' in error messages
- Fix code quality issues (trailing whitespace, blank lines)

This ensures hostpath fields properly validate string length before converting to Path objects,
preventing TypeError when length constraints are applied.
DeltaFile
+195-0src/middlewared/middlewared/pytest/unit/plugins/apps/test_schema_construction_utils.py
+19-1src/middlewared/middlewared/plugins/apps/pydantic_utils.py
+7-3src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+221-43 files

FreeNAS/freenas d40498dsrc/middlewared/middlewared/plugins/apps schema_construction_utils.py, src/middlewared/middlewared/pytest/unit/plugins/apps test_nested_show_if.py test_normalize_and_validate.py

Fix test_normalize_and_validate and clean up flake8 issues

- Fixed test_normalize_and_validate by properly mocking validate_values
  to return a mutable dictionary instead of a Dict schema object
- Removed unused pytest import from test_nested_show_if.py
- Fixed whitespace issues (W293, W291, W292) in both modified files
- All tests now pass successfully
DeltaFile
+16-18src/middlewared/middlewared/pytest/unit/plugins/apps/test_nested_show_if.py
+3-7src/middlewared/middlewared/pytest/unit/plugins/apps/test_normalize_and_validate.py
+2-2src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+21-273 files

FreeNAS/freenas e7605c4src/middlewared/middlewared/plugins/apps schema_construction_utils.py, src/middlewared/middlewared/pytest/unit/plugins/apps test_nested_show_if.py

Fix nested show_if evaluation with defaults

When evaluating show_if conditions, the code now properly builds an
evaluation context that includes default values from sibling fields.
This fixes the issue where fields with show_if conditions inside
hidden parent dicts would still cause validation errors.

The fix addresses the actual-budget app installation issue where
the path field was required even though its parent host_path_config
was hidden due to type='ix_volume' (default).

Changes:
- Build eval_context with both provided values and defaults
- Use eval_context for show_if evaluation instead of raw new_values
- Added test case for nested show_if with field-level conditions
- Fixed flake8 whitespace issues
DeltaFile
+109-0src/middlewared/middlewared/pytest/unit/plugins/apps/test_nested_show_if.py
+14-3src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+123-32 files

FreeNAS/freenas 49f095fsrc/middlewared/middlewared/plugins/apps schema_construction_utils.py, src/middlewared/middlewared/pytest/unit/plugins/apps test_defaults_and_notrequired.py test_nested_validation_error_paths.py

Fix NotRequired handling and improve default value population

- Fix remove_not_required() to handle string representations of NotRequired objects
  that appear when using dynamic Pydantic models
- Add comprehensive test coverage for default values and NotRequired handling
- Ensure empty dicts/lists are populated for non-required fields without defaults
- Allow explicitly provided values to override show_if conditions
- Update test expectations to match correct behavior where:
  - Non-required dict fields get empty dict defaults
  - Non-required list fields get empty list defaults
  - Explicitly provided values are included even when show_if=false
  - Fields with defaults are populated when not provided by user

This ensures consistent behavior for app schema validation and proper
handling of optional fields across all schema types.
DeltaFile
+932-0src/middlewared/middlewared/pytest/unit/plugins/apps/test_defaults_and_notrequired.py
+19-22src/middlewared/middlewared/pytest/unit/plugins/apps/test_nested_validation_error_paths.py
+20-0src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+9-7src/middlewared/middlewared/pytest/unit/plugins/apps/test_schema_construction_utils.py
+2-2src/middlewared/middlewared/pytest/unit/plugins/apps/test_normalize_and_validate.py
+1-2src/middlewared/middlewared/pytest/unit/plugins/apps/test_construct_schema.py
+983-331 files not shown
+984-347 files

FreeNAS/freenas ca47037src/middlewared/middlewared/plugins/apps schema_construction_utils.py, src/middlewared/middlewared/pytest/unit/plugins/apps test_nested_validation_error_paths.py test_schema_construction_utils.py

Fix nested validation error paths to exclude 'values' prefix

Previously, validation errors for nested fields were prefixed with 'values.'
(e.g., 'values.database.host' instead of just 'database.host'). This made
error messages less clear and inconsistent with field naming.

Changes:
- Modified construct_schema() to use verrors.extend() instead of
  verrors.add_child('values', e) to avoid adding the prefix
- Added comprehensive tests for nested validation error paths
- Updated existing tests to expect clean paths without prefix

This improves error reporting clarity for deeply nested app configurations.
DeltaFile
+228-0src/middlewared/middlewared/pytest/unit/plugins/apps/test_nested_validation_error_paths.py
+2-1src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+3-0src/middlewared/middlewared/pytest/unit/plugins/apps/test_schema_construction_utils.py
+233-13 files

FreeNAS/freenas 7211e62src/middlewared/middlewared/plugins/apps schema_normalization.py schema_validation.py

Properly make sure new_values is set
DeltaFile
+2-2src/middlewared/middlewared/plugins/apps/schema_normalization.py
+1-1src/middlewared/middlewared/plugins/apps/schema_validation.py
+3-32 files

FreeNAS/freenas 165c70esrc/middlewared/middlewared/plugins/apps schema_construction_utils.py

Add basic logic to construct pydantic models from app schema
DeltaFile
+141-0src/middlewared/middlewared/plugins/apps/schema_construction_utils.py
+141-01 files

FreeNAS/freenas 3c901c5src/middlewared/middlewared/pytest/unit/plugins/apps test_schema_construction_utils.py

Fix tests for schema construction utilities

- Update test_field_with_ref_metadata and test_field_with_dollar_ref to remove
  $ref metadata assertions after recent changes
- Add comprehensive tests for all field types through construct_schema:
  - test_construct_schema_with_ipaddr for IPv4/IPv6 validation
  - test_construct_schema_with_uri for URI validation and normalization
  - test_construct_schema_with_hostpath for path validation
  - test_construct_schema_with_path for absolute path validation
  - test_construct_schema_with_all_field_types for comprehensive coverage
- Ensure tests verify both model field types and data serialization
- Fix flake8 whitespace issues

All 78 tests now pass successfully.
DeltaFile
+401-6src/middlewared/middlewared/pytest/unit/plugins/apps/test_schema_construction_utils.py
+401-61 files

FreeNAS/freenas 7600a8esrc/middlewared/middlewared/pytest/unit/plugins/apps test_normalize_questions.py test_normalize_values.py

Update tests
DeltaFile
+123-31src/middlewared/middlewared/pytest/unit/plugins/apps/test_normalize_questions.py
+7-16src/middlewared/middlewared/pytest/unit/plugins/apps/test_normalize_values.py
+130-472 files