Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 11, 2025

  • Analyze CI error logs to identify the issue
  • Fix NoMethodError in libraries/ident.rb split_entries method
  • Add nil check for SPLIT_REGEX.match() to handle non-matching lines
  • Test the fix locally to ensure it works correctly
  • Verify CI passes with the fix

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] multiple mapping per map name in pg_ident Fix pg_ident to allow multiple mappings per map name Sep 11, 2025
@Copilot Copilot AI requested a review from damacus September 11, 2025 23:20
Copilot finished work on behalf of damacus September 11, 2025 23:20
Copilot AI and others added 3 commits September 18, 2025 18:55
Co-authored-by: damacus <40786+damacus@users.noreply.github.com>
Co-authored-by: damacus <40786+damacus@users.noreply.github.com>
Signed-off-by: Lance Albertson <lance@osuosl.org>
Copy link

Slowest examples

Top 10 slowest examples (0.02 seconds, 54.12% of total time)
Example Description Time in seconds
spec/libraries/helpers_spec.rb:19 PostgreSQL::Cookbook::Helpers#data_dir(version) with rhel family and Postgres 11 from repo returns the correct path 0.01302
spec/libraries/ident_spec.rb:32 PostgreSQL::Cookbook::IdentHelpers::PgIdent::PgIdentFile#add allows multiple entries with the same map_name but different system/database usernames 0.00333
spec/libraries/ident_spec.rb:80 PostgreSQL::Cookbook::IdentHelpers::PgIdent::PgIdentFile#entry returns first entry when only map_name is provided and multiple entries exist 0.00274
spec/libraries/helpers_spec.rb:81 PostgreSQL::Cookbook::Helpers#conf_dir(version) with debian family and Postgres 11 from os returns the correct path 0.00044
spec/libraries/helpers_spec.rb:35 PostgreSQL::Cookbook::Helpers#data_dir(version) with debian family and Postgres 11 from repo returns the correct path 0.0004
spec/libraries/helpers_spec.rb:27 PostgreSQL::Cookbook::Helpers#data_dir(version) with rhel family and Postgres 11 from os returns the correct path 0.00039
spec/libraries/helpers_spec.rb:43 PostgreSQL::Cookbook::Helpers#data_dir(version) with debian family and Postgres 11 from os returns the correct path 0.00038
spec/libraries/helpers_spec.rb:27 PostgreSQL::Cookbook::Helpers#data_dir(version) with rhel family and Postgres 12 from os returns the correct path 0.00037
spec/libraries/helpers_spec.rb:103 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with rhel family and Postgres 11 from os returns the correct service name 0.00037
spec/libraries/helpers_spec.rb:43 PostgreSQL::Cookbook::Helpers#data_dir(version) with debian family and Postgres 13 from os returns the correct path 0.00036

@ramereth
Copy link
Contributor

@copilot look at the error in the CI logs and fix the issue

Co-authored-by: ramereth <48997+ramereth@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 19, 2025

@copilot look at the error in the CI logs and fix the issue

Fixed the NoMethodError in the CI logs. The issue was in the split_entries method where SPLIT_REGEX.match(entry) could return nil for lines that don't match the expected pg_ident format (like empty lines or comments), and calling .named_captures on nil caused the error. Added a nil check to handle non-matching lines gracefully. Fix committed in b0ad5f4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants