-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert "revert: "feat: Put back telemetry" (#1001)" This reverts commit a516872. * fix: Fix runner token telemetry event * fix: Allow runner commands to run their PersistentPreRun With cobra, when you define a PersistentPreRun in a child command, you overwrite all the command's parents PersistentPreRun. When introducing telemetry, we used the PersistentPreRun to send the events, this made the runner commands not call the PersistentPreRun in cmd/runner/runner.go which defines the 'opts.r' value. In the commands the 'opts.r' was nil, thus causing nil pointer deference panic. This commit uses the PreRunE to send the telemetry event instead of the PersistentPreRun to avoid this issue.
- Loading branch information
1 parent
3eaefd7
commit b3874b3
Showing
50 changed files
with
2,363 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package clitest | ||
|
||
import ( | ||
"encoding/json" | ||
"os" | ||
|
||
"github.com/CircleCI-Public/circleci-cli/telemetry" | ||
"github.com/onsi/gomega" | ||
) | ||
|
||
func CompareTelemetryEvent(settings *TempSettings, expected []telemetry.Event) { | ||
content, err := os.ReadFile(settings.TelemetryDestPath) | ||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) | ||
|
||
result := []telemetry.Event{} | ||
err = json.Unmarshal(content, &result) | ||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) | ||
gomega.Expect(result).To(gomega.Equal(expected)) | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.