-
Notifications
You must be signed in to change notification settings - Fork 6
feat: migrate types #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: migrate types #177
Conversation
feat: tiktok scraper common types
- Add LinkedInSearchArguments for search queries - Add LinkedInProfileResult for profile data - Support network filters and pagination
…#2) - Rename LinkedInSearchArguments to LinkedInArguments for broader scope - Add PublicIdentifier field to support individual profile fetching - Maintain backward compatibility with deprecated type alias - Field uses omitempty tag to preserve existing search functionality - Enables dual-purpose struct for both search and profile operations
- Add comprehensive overview of package capabilities - Document LinkedIn search and profile fetching usage examples - Update structure section with detailed file descriptions - Add backward compatibility information - Include installation instructions with v1.0.0 tag - Add release history section
feat: job types
fix: use jobtype instead of string
fix: remove searchbyfullarchive subtype from cred based capabilities
feat: refactored jobs to jobtype as key
feat: adds web and llm types and arguments
* fix: add max pages to llm args * chore: fix test * fix: rename to items * chore: fix test * fix: rename vars * chore: relevant llm args to uint instead of int * chore: temperature as a float * chore: fix test * chore: fix llm test * fix: llm test * fix: temperature test
* chore: add job arguments and job struct to types to prep for acceptance tests not needing ego imports * chore: add count guard on twitter args * chore: adds guards * chore: adds var for max results * fix: error message * fix: allow unmarshalling on job types * chore: adds unmarshal to job args
* fix: default model * feat: support many models * fix: be more idiomatic * chore: add dynamic key * chore: use util set * chore: fix llm test * chore: add key test
* feat: linkedin * fix: validation tests * chore: fix unmarshalling tests * chore: adds basic linkedin type tests * chore: cleanup type tests for linkedin * chore: cleanup errors * Update args/linkedin/profile/profile.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update types/linkedin/industries/industries.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update types/linkedin/industries/industries.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update types/linkedin/industries/industries.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update types/linkedin/industries/industries.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update types/linkedin/industries/industries.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update types/linkedin/industries/industries.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update types/linkedin/industries/industries.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update types/linkedin/industries/industries.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update types/linkedin/profile/profile.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: fix spacing * chore: omit empty * chore: fix missing omit * fix: profile marshalling * chore: update umarshalling for mode * chore: update profile * chore: fixes test * fix: max * fix: omitempty * chore: cleanup --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Added args/, types/, and pkg/util/ directories from tee-types - Preserved complete git history from tee-types - Resolved merge conflicts in go.mod, .gitignore, README.md, and go.sum - Removed external tee-types dependency from go.mod
- Successfully merged tee-types into tee-worker with preserved git history - Moved args/ to api/args/ and types/ to api/types/ - Updated all import paths from external tee-types to local paths - Removed external tee-types dependency from go.mod - Removed tee-worker specific files (job.go, encrypted.go, key.go) from types package - All merged packages (api/types, api/args, pkg/util) build successfully - Ready for CI integration and final testing
- Merged job.go and jobs.go into a single jobs.go file - Created api/tee package to isolate tee-specific functionality - Moved GenerateJobSignature, SealJobResult, DecryptJob to api/tee package - Moved EncryptedRequest and related types to api/tee package - Updated routes.go to use the new api/tee package - Types and args packages now build without ego dependency - Clients can import types/args without needing ego library
- Updated pkg/client/http.go to import api/tee for EncryptedRequest - Fixed teetypes.Job reference to use types.Job - Updated internal/api/routes.go to use teejob.EncryptedRequest - Resolved compilation errors from the consolidation
- Fixed duplicate imports (teetypes/teeargs aliases) across all internal files - Updated all teetypes.* and teeargs.* references to use direct types.* and args.* - Added missing imports to internal/apify/actors.go and internal/config/config.go - Fixed reddit package path references - All internal packages now build without import errors
There was a problem hiding this 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 migrates all type definitions from the external tee-types
package into the local tee-worker/api/types/
directory, consolidating the codebase and eliminating the external dependency. The migration includes comprehensive job argument validation, capability-based job routing, and enhanced support for multiple scraping platforms.
Key changes:
- Complete removal of external
tee-types
dependency and migration of all types to localapi/
directory - Implementation of type-safe job argument unmarshalling with comprehensive validation
- Addition of utility functions for mathematical operations and set operations
Reviewed Changes
Copilot reviewed 83 out of 89 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
pkg/util/set.go |
Implements generic Set data structure with union, intersection, and difference operations |
pkg/util/math.go |
Adds Min and Max utility functions for ordered types |
api/types/*.go |
Consolidates all type definitions from external tee-types package |
api/args/*.go |
Implements type-safe job argument structures with validation |
internal/jobs/*.go |
Updates all job handlers to use local types instead of external tee-types |
pkg/client/http.go |
Updates HTTP client to use local types |
Files not reviewed (4)
- .idea/.gitignore: Language not supported
- .idea/modules.xml: Language not supported
- .idea/tee-types.iml: Language not supported
- .idea/vcs.xml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes!
I think there is one small thing to look at here - how the tee indexer imports the tee client. not 100% sure it needs the ego import, investigating... |
It was just this piece importing tee / ego, so duplicated in client code type EncryptedRequest struct {
EncryptedResult string `json:"encrypted_result"`
EncryptedRequest string `json:"encrypted_request"`
} |
can't we move it from the worker in a place that doesn't have ego imports? |
High-Level Summary of tee-worker PR Changes
Major Architectural Changes
TEE Types Migration - The most significant change is the complete migration and consolidation of the
tee-types
repository intotee-worker
. This involved:tee-types
package intotee-worker/api/types/
tee-types
Job System Refactoring - Complete overhaul of the job handling system:
JobType
system with proper validationNew Features Added
LinkedIn Integration - Full LinkedIn scraping capabilities:
Enhanced Scraping Support:
Utility Functions - Added new utility packages:
Min
,Max
functions)Code Quality Improvements
Testing Infrastructure:
Configuration and Development:
API and Client Changes
Client Library Updates:
tee-types
Internal API Refactoring:
Key Technical Details
tee-types
dependencyThis PR represents a major consolidation effort that brings all TEE-related types and functionality under one repository while significantly expanding the scraping capabilities and improving the overall architecture of the system.