Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 31, 2025

  • Implement fabric label 32-character limit validation in MatterDeviceController
  • Add truncation logic with informative logging for labels exceeding 32 characters
  • Create comprehensive test suite for fabric label validation
  • Fix lint errors identified in CI (ruff and pylint issues)
  • Ensure backward compatibility for existing labels ≤ 32 characters
  • Handle edge cases (None values, empty strings, unicode characters)

The implementation now includes:

  • Validation in set_default_fabric_label method to check label length
  • Automatic truncation to exactly 32 characters for long labels
  • INFO-level logging when truncation occurs
  • Comprehensive test coverage with 6 test cases
  • All lint checks passing (ruff and pylint)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Aug 31, 2025

@Apollon77 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@Copilot Copilot AI changed the title [WIP] Limit the fabric label to 32 characters in the Pythin Matter server Limit fabric label to 32 characters with truncation and logging Aug 31, 2025
@Copilot Copilot AI requested a review from Apollon77 August 31, 2025 10:24
Copilot finished work on behalf of Apollon77 August 31, 2025 10:24
@Apollon77 Apollon77 marked this pull request as ready for review August 31, 2025 10:28
@Apollon77 Apollon77 added bugfix Pull request that fixes a (known) issue/bug python Pull requests that update Python code labels Aug 31, 2025
@Apollon77 Apollon77 requested a review from marcelveldt August 31, 2025 10:29
@Apollon77
Copy link
Contributor

- Add missing docstring to __init__ method
- Remove unused imports (asyncio, Mock, MagicMock)
- Add pylint disable for protected-access in test file
- Fix formatting issues (blank lines, newline at end)
- Ensure all ruff and pylint checks pass

Co-authored-by: Apollon77 <[email protected]>
Copy link
Contributor Author

Copilot AI commented Aug 31, 2025

@copilot Please check the lint error from CI - see https://github.com/matter-js/python-matter-server/actions/runs/17355814776/job/49268749287?pr=1229#step:5:1

Fixed the lint errors in commit e14a83e. The issues were in the test file I created:

Ruff errors fixed:

  • Added missing docstring to __init__ method
  • Removed unused imports (asyncio, Mock, MagicMock)
  • Fixed formatting issues (blank lines, newline at end)

Pylint errors fixed:

  • Added # pylint: disable=protected-access for test file (accessing _default_fabric_label is expected in tests)

All lint checks now pass:

  • ruff check - All checks passed
  • ruff format - File properly formatted
  • pylint - Rated 10.00/10

The fabric label validation functionality and tests work correctly.

Copilot finished work on behalf of Apollon77 August 31, 2025 10:39
Copy link
Collaborator

@agners agners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marcelveldt marcelveldt merged commit cb500a3 into main Sep 3, 2025
8 checks passed
@marcelveldt marcelveldt deleted the copilot/fix-1228 branch September 3, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a (known) issue/bug python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants