Shopify / Shopify/ci-queue

CI::Queue::Static and CI::Queue::File initialization is broken

Open
#42 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
239
Forks
36
Avg merge
28m
Merged PRs (30d)
3

Description

After https://github.com/Shopify/ci-queue/pull/34, you need to initialize the File and Static queue passing the file name or the test respectively and you also need to populate the queue with the list of tests. This seems contra-intuitive.

Maybe the initialize should only take the config and the populate the list of tests and add a .populate class method (or any other name) that does what the initialize used to do.

Also those queues require a configuration object that is not needed in most of its use cases. Making it optional, or adding a high level method as .populate that creates the configuration object would be great.

cc @casperisfine @wvanbergen @tjoyal


Nitpick:

The @index instance variable is only set after you call #populate so if you don't you get a "non-method error fetch for nil" in the to_a method and a ruby warning because the instance variable is not initialized. Maybe we should try to write warning free code so we could avoid this kind of error?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing initialization for CI::Queue::Static and CI::Queue::File, then inspect how #populate and #to_a interact with the queue list and @index. Clarify the intended API for configuration, test population, and the proposed .populate class method before changing it. Done means common use cases need no unnecessary configuration and unpopulated queues do not produce nil-method errors or Ruby warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
ci-cd, testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.