Skip to content

Init config refactor#2035

Merged
jhiemstrawisc merged 19 commits into
PelicanPlatform:mainfrom
turetske:init-config-refactor
Jul 9, 2025
Merged

Init config refactor#2035
jhiemstrawisc merged 19 commits into
PelicanPlatform:mainfrom
turetske:init-config-refactor

Conversation

@turetske

@turetske turetske commented Feb 21, 2025

Copy link
Copy Markdown
Collaborator

Moved InitConfig into InitServer and InitClient and adjusts the tests as needed.

Also made InitConfigDir platform agnostic.

Ideally, I would like to be able to make InitConfig private, but its use in the cmd/config_printer test makes that impossible.

I'm worried InitConfig will keep being used in tests until we figure out a solution for that if the author/reviewer don't catch it organically.

@turetske turetske requested a review from Saartank February 21, 2025 20:18
@turetske turetske added the internal Internal code improvements, not user-facing label Feb 21, 2025
@turetske turetske added this to the v7.14 milestone Feb 21, 2025
@turetske turetske marked this pull request as draft February 21, 2025 20:41
@turetske turetske modified the milestones: v7.14, v7.15 Feb 24, 2025
@turetske turetske force-pushed the init-config-refactor branch 2 times, most recently from 42bf05f to f55f544 Compare February 27, 2025 21:12
@turetske turetske marked this pull request as ready for review February 27, 2025 21:38

@Saartank Saartank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, the log file initialization code runs when InitServer is executed. However, some code is executed before InitServer is reached. Because of this, all logs generated before InitServer runs will be output to the console even if the log file is configured. This could be problematic if something goes wrong before InitServer is reached, as the log file would not contain the relevant information.

Comment thread client/director_test.go Outdated
@turetske turetske modified the milestones: v7.15, v7.16 Mar 21, 2025
@turetske turetske force-pushed the init-config-refactor branch from f55f544 to 40118c7 Compare March 24, 2025 22:24
@turetske turetske force-pushed the init-config-refactor branch from 40118c7 to 9e7b6d0 Compare April 11, 2025 02:46
@turetske turetske requested review from Saartank and jhiemstrawisc and removed request for Saartank April 11, 2025 03:23
Comment thread xrootd/authorization_test.go Outdated
Comment thread xrootd/authorization_test.go Outdated
Comment thread client/sharing_url_test.go Outdated
Comment thread cmd/resources/public-test-origin.yml Outdated
Comment thread cmd/resources/public-test-origin.yml Outdated
Comment thread director/fed_token_test.go
Comment thread fed_test_utils/fed.go Outdated
Comment thread server_utils/origin.go
Comment thread xrootd/xrootd_config_test.go Outdated
Comment thread cmd/plugin_test.go
@turetske turetske requested a review from jhiemstrawisc April 16, 2025 16:27
Comment thread client/fed_test.go Outdated
Comment thread cmd/plugin_test.go Outdated
Comment thread cmd/plugin_test.go Outdated
Comment thread config/config.go Outdated
Comment thread config/config.go
Comment thread fed_test_utils/fed.go Outdated
Comment thread fed_test_utils/fed.go Outdated
Comment thread fed_test_utils/fed.go Outdated
Comment thread fed_test_utils/fed.go
Comment thread fed_test_utils/fed.go Outdated
@jhiemstrawisc jhiemstrawisc modified the milestones: v7.16, v7.17 Apr 22, 2025
@turetske turetske force-pushed the init-config-refactor branch from 787ec30 to 3b0c518 Compare June 12, 2025 18:35
@turetske turetske assigned jhiemstrawisc and unassigned Saartank Jun 12, 2025
@turetske turetske force-pushed the init-config-refactor branch from 2c139bc to 11d53b7 Compare June 12, 2025 21:47
@turetske turetske requested a review from jhiemstrawisc June 26, 2025 16:59
Comment thread config/config.go
Comment thread config/config.go
@jhiemstrawisc

Copy link
Copy Markdown
Member

By the way, the failing tests look like a bug I must have introduced to main recently. I'll dig into it.

jhiemstrawisc added a commit to jhiemstrawisc/pelican that referenced this pull request Jun 27, 2025
Some tests use IP addresses from http test servers for various
Pelican server configs (e.g. 'Server.ExternalWebUrl'). When we do
this, the certificates Pelican generates for itself are invalid because
they contain a SAN that says the IP is a DNS entry.

This was exposed in tests for PelicanPlatform#2035 after it picked up the new
verification code that checks the cert against configured hostnames.
@jhiemstrawisc

Copy link
Copy Markdown
Member

@turetske Assuming #2457 is approved, I've already checked that rebasing against it appears to fix these tests for me locally.

@turetske turetske force-pushed the init-config-refactor branch from 4887d9c to 22a46bc Compare July 7, 2025 21:48
@turetske turetske requested a review from jhiemstrawisc July 7, 2025 22:28

@jhiemstrawisc jhiemstrawisc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the last round of tests look okay, I think this is ready! Thanks!!

@jhiemstrawisc jhiemstrawisc merged commit e9c606d into PelicanPlatform:main Jul 9, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Internal code improvements, not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InitConfig refactor to fix initConfigDir and proper InitServer/InitClient testing. InitConfigDir is not platform agnostic

3 participants