Feature: support static config for Semian::NetHTTP and Semian::GRPC
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.5k
- Forks
- 88
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 5
Description
Background
MySQL and Redis supports static config, while NetHTTP and GRPC currently only Proc. e.g.
https://github.com/Shopify/semian/blob/1d4b53be7819707f9c6eebc17bb9b50b46619271/lib/semian/mysql2.rb#L137-L140
https://github.com/Shopify/semian/blob/1d4b53be7819707f9c6eebc17bb9b50b46619271/lib/semian/net_http.rb#L67-L69
https://github.com/Shopify/semian/blob/1d4b53be7819707f9c6eebc17bb9b50b46619271/lib/semian/grpc.rb#L48-L50
Problem
If pass a static config to NetHTTP and GRPC, semian is disabled because retrieve_semian_configuration returns nil.
Proposal
allow static config if it is not callable
def retrieve_semian_configuration(host, port)
return @semian_configuration unless @semian_configuration.respond_to?(:call)
@semian_configuration.call(host, port)
end
Alternative
Add validation to semian_configuration setter, assert whether static config or Proc is expected
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/semian/net_http.rb and lib/semian/grpc.rb, especially the semian_configuration setter and retrieve_semian_configuration methods; compare their behavior with the referenced implementation in lib/semian/mysql2.rb. Verify that static configurations are returned for both integrations, callable configurations still receive host and port, and the relevant existing tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100