Skip to content

Commit

Permalink
[BREAKING] Removed debugging_supported field from BoardDetails gR…
Browse files Browse the repository at this point in the history
…PC call (#2438)

* Removed debugging_supported field from BoardDetailsResponse

* fix typo
  • Loading branch information
cmaglie committed Nov 24, 2023
1 parent 1d595cb commit 5b2f729
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 192 deletions.
9 changes: 1 addition & 8 deletions commands/board/details.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai
return nil, &arduino.InvalidFQBNError{Cause: err}
}

boardPackage, boardPlatform, board, boardProperties, boardRefPlatform, err := pme.ResolveFQBN(fqbn)
boardPackage, boardPlatform, board, boardProperties, _, err := pme.ResolveFQBN(fqbn)
if err != nil {
return nil, &arduino.UnknownFQBNError{Cause: err}
}
Expand All @@ -64,13 +64,6 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai
details.BuildProperties, _ = utils.ExpandBuildProperties(details.BuildProperties)
}

details.DebuggingSupported = boardProperties.ContainsKey("debug.executable") ||
boardPlatform.Properties.ContainsKey("debug.executable") ||
(boardRefPlatform != nil && boardRefPlatform.Properties.ContainsKey("debug.executable")) ||
// HOTFIX: Remove me when the `arduino:samd` core is updated
boardPlatform.String() == "arduino:[email protected]" ||
boardPlatform.String() == "arduino:[email protected]"

details.Package = &rpc.Package{
Name: boardPackage.Name,
Maintainer: boardPackage.Maintainer,
Expand Down
14 changes: 13 additions & 1 deletion docs/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@

Here you can find a list of migration guides to handle breaking changes between releases of the CLI.

## v0.35.0
## 0.35.0

### `debugging_supported` field has been removed from gRPC `cc.arduino.cli.commands.v1.BoardDetails` and `board details` command in CLI

The `debugging_supported` field has been removed, since the possibility to debug is determined by:

- the board selected
- the board option selected
- the programmer selected

the `board details` command has no sufficient information to determine it. If you need to determine if a specific
selection of board + option + programmer supports debugging, use the gRPC call
`cc.arduino.cli.commands.v1.GetDebugConfig`: if the call is successful, it means that the debugging is supported.

### CLI `debug --info` changed JSON output.

Expand Down
3 changes: 0 additions & 3 deletions internal/cli/board/details.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ func (dr detailsResult) String() string {
t.AddRow(tr("Board name:"), details.Name)
t.AddRow(tr("FQBN:"), details.Fqbn)
addIfNotEmpty(tr("Board version:"), details.Version)
if details.GetDebuggingSupported() {
t.AddRow(tr("Debugging supported:"), table.NewCell("✔", color.New(color.FgGreen)))
}

if details.Official {
t.AddRow() // get some space from above
Expand Down
3 changes: 1 addition & 2 deletions internal/integrationtest/board/board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,8 @@ func TestBoardDetails(t *testing.T) {
_, _, err = cli.Run("core", "install", "arduino:[email protected]")
require.NoError(t, err)

stdout, _, err = cli.Run("board", "details", "-b", "arduino:samd:nano_33_iot", "--format", "json")
_, _, err = cli.Run("board", "details", "-b", "arduino:samd:nano_33_iot", "--format", "json")
require.NoError(t, err)
requirejson.Contains(t, stdout, `{"debugging_supported": true}`)
}

func TestBoardDetailsNoFlags(t *testing.T) {
Expand Down
Loading

0 comments on commit 5b2f729

Please sign in to comment.