Implement setting project attributes via project:info#1544
Open
pjcdawkins wants to merge 2 commits into5.xfrom
Open
Implement setting project attributes via project:info#1544pjcdawkins wants to merge 2 commits into5.xfrom
pjcdawkins wants to merge 2 commits into5.xfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for setting map-style project attributes via dot notation (attributes.key) in the pro:info command.
- Detects
propertystrings containing.to treat them as map updates. - Retrieves the correct type for map entries (
attributes.*) and handles current vs. new values. - Adjusts the API payload to use a nested array for map updates and adds an end-to-end test for setting an attribute.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Command/Project/ProjectInfoCommand.php | Adds isMap logic, type support for attributes.*, and nested update payload for map entries |
| go-tests/project_info_test.go | Adds test for setting an attribute via dot notation |
| go-tests/go.mod | Bumps Go version and dependency versions |
Comments suppressed due to low confidence (2)
src/Command/Project/ProjectInfoCommand.php:114
- Update or add a docblock above
setPropertyto document the new map support via dot notation, parameters ($mapName,$mapKey) and expected behavior for nested updates.
protected function setProperty(string $property, string $value, Project $project, bool $noWait): int
go-tests/project_info_test.go:86
- Consider adding an assertion on the verbose output to confirm the expected confirmation message (e.g.,
Property attributes.foo set to: bar), and a test that existing attributes remain after setting a new one.
f.Run("pro:info", "-v", "-p", projectID, "attributes.foo", "bar")
d0cc7ed to
6f8efe7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Projects support an
attributeskey, which is a map of string pairs.AI assistance note
I tried to use Cursor for the implementation: it sort of succeeded with guidance but it was very messy, so I rewrote it. GitHub Copilot's review has been useful.