Add #find_by_id_through_partition to Ci::Pipeline
What does this MR do and why?
Adds a helper method that looks up pipelines by ID, first attempting to search within the current partition for improved query performance when partition pruning is enabled, then falling back to a global search if not found.
This allows PostgreSQL to prune irrelevant partitions and reduces query cost for the common case where the pipeline belongs to the current partition.
The change is gated behind the existing ci_partition_pruning_workers
feature flag, added in !227525 (merged)