Skip to content

[datastore] Normalize datastore initialization across the codebase with a generic dial function#1409

Merged
mickmis merged 1 commit intointeruss:masterfrom
Orbitalize:generic_dialer
Apr 7, 2026
Merged

[datastore] Normalize datastore initialization across the codebase with a generic dial function#1409
mickmis merged 1 commit intointeruss:masterfrom
Orbitalize:generic_dialer

Conversation

@the-glu
Copy link
Copy Markdown
Contributor

@the-glu the-glu commented Mar 31, 2026

Follow #1408 , extracted from #1403

Move to a generic dial function, normalizing datastore.Dial calls, checks of errors and (optional) cron creation.

connectParameters := flags.ConnectParameters()
connectParameters.DBName = "aux"
datastore, err := datastore.Dial(ctx, connectParameters)
auxStore, err := auxc.Dial(ctx, logger, true)
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.

The withCronCheck should be false here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are you sure? I would normalize scd/rid/aux there, no? Why aux wouldn't be checked like the others?

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.

I was talking about behavior change.
About normalizing yes makes sense but in a separate PR then? If this behavior change causes any type of issue or interrogation, a commit message with 'generic dial function' won't help identifying the change, even more so when obfuscated by a refactor like here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, but the whole PR is about normalizing initializations, that not the only behavior change and this one is really minor, do you really see the need of moving it to a separate PR?

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.

that not the only behavior change

Which ones did I miss?

this one is really minor

I disagree, it is a pretty visible one, one more DB is going to have pings every minutes. That deserves to be mentioned in the changelog IMO, thus should be included in the git commit message. If it is too much overhead to open a separate PR, a mention of the change in the title of this PR could also work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

After discussions, updated PR title + added remark in changelog.

@the-glu the-glu force-pushed the generic_dialer branch 2 times, most recently from 8111dcd to cd706cb Compare April 7, 2026 10:18
@the-glu the-glu changed the title [datastore] Generic 'Dial' function [datastore] Normalize datastore initialization across the codebase with a generic dial function Apr 7, 2026
@the-glu the-glu requested a review from mickmis April 7, 2026 13:23
@mickmis mickmis merged commit af97627 into interuss:master Apr 7, 2026
12 checks passed
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.

2 participants