Skip to content

Add campaigns tool#56

Merged
wesleyjellis merged 2 commits intomainfrom
wesley/campaigns
Jun 13, 2025
Merged

Add campaigns tool#56
wesleyjellis merged 2 commits intomainfrom
wesley/campaigns

Conversation

@wesleyjellis
Copy link
Copy Markdown
Contributor

Expose campaigns (without checks) as a new tool. Default filter only shows in progress campaigns

Problem

Users of the mcp server can't see what campaigns exist in opslevel

Solution

Add a tool to list campaigns in opslevel!

Doesn't include a way to see campaigns for a particular service and it doesn't show the details of the checks yet

Checklist

  • I have run this code, and it appears to resolve the stated issue.
  • This PR has no user interface changes or has already received approval from product management to change the interface.
  • Make a changie entry that explains the customer facing outcome of this change.

Expose campaigns (without checks) as a new tool. Default filter only
shows in progress campaigns
@wesleyjellis wesleyjellis requested a review from Copilot June 13, 2025 13:11
Copy link
Copy Markdown

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

@derek-etherton-opslevel derek-etherton-opslevel left a comment

Choose a reason for hiding this comment

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

we'll need to push in the opslevel-go changes first and then update submodules, but lgtm!

Comment thread src/cmd/root.go Outdated
Comment thread src/cmd/root.go
Comment thread src/cmd/root.go
Comment on lines +569 to +589
if node.Owner != (opslevel.TeamId{}) {
c.Owner = &node.Owner
}
if node.StartDate != (iso8601.Time{}) {
c.StartDate = &node.StartDate
}
if node.EndedDate != (iso8601.Time{}) {
c.EndedDate = &node.EndedDate
}
if node.TargetDate != (iso8601.Time{}) {
c.TargetDate = &node.TargetDate
}
if len(node.Reminder.Channels) > 0 {
c.Reminder = &node.Reminder
}
if node.Filter != (opslevel.FilterId{}) {
c.Filter = &node.Filter
}
if node.CheckStats != (opslevel.Stats{}) {
c.CheckStats = node.CheckStats
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've never seen syntax like this before - TIL

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe not very golike but I don't know how else to see if the value is the same as the default constructor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@wesleyjellis no it makes sense in this usecase i've just never seen it before. Its verbose for sure but understandable. 👍

@wesleyjellis wesleyjellis merged commit e7cc633 into main Jun 13, 2025
2 checks passed
@wesleyjellis wesleyjellis deleted the wesley/campaigns branch June 13, 2025 17:57
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.

4 participants