Skip to content

Conversation

@jirispilka
Copy link
Collaborator

No description provided.

@github-actions github-actions bot added the t-ai Issues owned by the AI team. label May 13, 2025
@jirispilka jirispilka requested a review from MQ37 May 13, 2025 08:59
@jirispilka jirispilka changed the title fix: Use a new API to get Actor default build` fix: Use a new API to get Actor default build May 13, 2025
@jirispilka jirispilka requested a review from Copilot May 13, 2025 09:00
Copy link
Contributor

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 updates the Actor default build retrieval logic to use the new API endpoint instead of the previous tagging fallback, and it updates the documentation and dependency version accordingly.

  • Update to src/tools/build.ts to fetch build details via the new API client.
  • Documentation update in src/tools/actor.ts to include the apifyToken parameter.
  • Dependency version bump for apify-client in package.json.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/tools/build.ts Updated to use the new API endpoint for default builds
src/tools/actor.ts Updated function docs to reflect the apifyToken parameter
package.json Upgraded apify-client version to support the new API

const tag = actor.defaultRunOptions?.build || '';
const buildId = actor.taggedBuilds?.[tag]?.buildId || '';
const defaultBuildClient = await actorClient.defaultBuild();
const buildDetails = await defaultBuildClient.get();
Copy link

Copilot AI May 13, 2025

Choose a reason for hiding this comment

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

[nitpick] The previous implementation logged an error when the build details were missing. Consider adding error logging here to aid troubleshooting in case the new API returns no actorDefinition.

Suggested change
const buildDetails = await defaultBuildClient.get();
const buildDetails = await defaultBuildClient.get();
if (!buildDetails) {
log.error(`Failed to fetch build details for Actor: ${actorIdOrName}. Build details not found.`);
return null;
}

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@MQ37 MQ37 left a comment

Choose a reason for hiding this comment

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

haven't tested but LGTM 👍

@jirispilka jirispilka merged commit 6236e44 into master May 13, 2025
2 checks passed
@jirispilka jirispilka deleted the fix/get-default-build branch May 13, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ai Issues owned by the AI team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants