Skip to content

feat: CP-1068 Create MCP tool to bump timestamp of a project#3713

Merged
samueld-activator merged 3 commits intomasterfrom
samueld/CP-1068
Aug 21, 2025
Merged

feat: CP-1068 Create MCP tool to bump timestamp of a project#3713
samueld-activator merged 3 commits intomasterfrom
samueld/CP-1068

Conversation

@samueld-activator
Copy link
Contributor

@samueld-activator samueld-activator commented Aug 21, 2025

StoryCP-1068 Create MCP tool to bump timestamp of a project

Script: bumpedBS,
})
if err != nil {
return errs.Wrap(err, "Failed to stage bumped commit")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When it does not solve, it errors here.

e.g.:
`Failed to stage bumped commit:
failed to poll build plan:
Request failed: Could not plan build. Platform responded with:
These are the last lines of the error message:
….2.36) requires Ingredient|language/python|fast-agent-mcp (0.2.36) which depends on Feature|language/python|opentelemetry-instrumentation-google-genai (>=0.2b0), Feature|language/python|fast-agent-mcp (0.2.36) requires Feature|language/python|opentelemetry-instrumentation-google-genai (>=0.2b0).

    So, because no versions of Feature|language/python|opentelemetry-instrumentation-google-genai match >=0.2b0
     and root depends on Feature|language/python|fast-agent-mcp (0.2.36), version solving failed.`

}
}

func (runner *ProjectErrorsRunner) Run(params *Params) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This func is based off of /internal/runners/upgrade/upgrade.go
It isn't bumping the timestamp and I don't know why yet. Perhaps it's missing something after StageCommitAndPoll

return fmt.Errorf("error fetching default branch: %w", err)
}

// Collect "before" buildplan
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Collect "before" buildplan
// Collect "before" buildscript

return errs.Wrap(err, "Failed to fetch build result")
}

// Collect "after" buildplan
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Collect "after" buildplan
// Collect "after" buildscript

Comment on lines +61 to +67
now := captain.TimeValue{}
now.Set("now")
ts, err := commits_runbit.ExpandTime(&now, runner.auth)
if err != nil {
return errs.Wrap(err, "Failed to fetch latest timestamp")
}
bumpedBS.SetAtTime(ts, true)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is for facilitating flag parsing, it's a roundabout way of grabbing the time if you already know that you want "now". In this case you can just call the underlying logic:

latest, err := model.FetchLatestRevisionTimeStamp(auth)
if err != nil {
return time.Time{}, errs.Wrap(err, "Unable to determine latest revision time")
}
return latest, nil
}

I wouldn't expect to see any use of the captain package in mcp tooling, that's specifically for command line handling, so a red flag.

"github.com/ActiveState/cli/pkg/project"
)

type ProjectErrorsRunner struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename to reflect directory name.

Comment on lines +32 to +40
type Params struct {
project *project.Namespaced
}

func NewParams(project *project.Namespaced) *Params {
return &Params{
project: project,
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make Project public. And nitpick but NewParams() should not take any of the params if we are to stick to the pattern.

When interacting with runners via the CLI (ie. via captain) we use params to pass properties by reference, which we can't do if they're private and only provided as arguments to a constructor function.

Copy link
Contributor

@Naatan Naatan left a comment

Choose a reason for hiding this comment

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

Nice work!

@samueld-activator samueld-activator merged commit 0d2d53c into master Aug 21, 2025
7 of 8 checks passed
@samueld-activator samueld-activator deleted the samueld/CP-1068 branch August 21, 2025 20:24
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.

2 participants