Skip to content

Conversation

pjcdawkins
Copy link
Collaborator

@pjcdawkins pjcdawkins commented Jul 3, 2025

Projects support an attributes key, 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.

@pjcdawkins pjcdawkins requested a review from Copilot July 3, 2025 11:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for setting map-style project attributes via dot notation (attributes.key) in the pro:info command.

  • Detects property strings 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 setProperty to 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")

@pjcdawkins pjcdawkins force-pushed the project-info-attributes branch from d0cc7ed to 6f8efe7 Compare July 3, 2025 11:03
@pjcdawkins pjcdawkins marked this pull request as ready for review July 3, 2025 11:06
@pjcdawkins pjcdawkins changed the title Implement setting project attribute via project:info Implement setting project attributes via project:info Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant