Skip to content

Fix ubuntu ci and start testing PG18 #2893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2025
Merged

Conversation

robe2
Copy link
Member

@robe2 robe2 commented May 22, 2025

  • Add PG 18 to testing
  • Purge old PostgreSQL install so new one is already 5432
  • remove 20.04, that is no longer available
  • Use apt.postgresql.org -testing repo, so can test PG18
  • Use trustpg instead of deprecated apt key for repo cert

Summary by CodeRabbit

  • Chores
    • Updated test workflows to include PostgreSQL 18 and remove Ubuntu 20.04.
    • Improved PostgreSQL installation steps for reliability and consistency in testing environments.
    • Standardized PostgreSQL port usage during tests.

 - Add PG 18 to testing
 - Purge old PostgreSQL install so new one is already 5432
 - remove 20.04, that is no longer available
 - Use apt.postgresql.org -testing repo, so can test PG18
@robe2 robe2 requested a review from cvvergara May 22, 2025 00:50
Copy link
Contributor

coderabbitai bot commented May 22, 2025

Walkthrough

The Ubuntu GitHub Actions workflow was updated to add PostgreSQL 18 to the test matrix, remove Ubuntu 20.04, and revise the PostgreSQL repository setup and installation steps. The workflow now uses a fixed port for PostgreSQL and sets APT pinning for the PostgreSQL repository.

Changes

File(s) Change Summary
.github/workflows/ubuntu.yml Updated test matrix to add PostgreSQL 18 and remove Ubuntu 20.04; revised PostgreSQL repo setup, APT pinning, installation steps, and fixed PGPORT usage.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Ubuntu Runner
    participant PostgreSQL Repo

    GitHub Actions->>Ubuntu Runner: Start workflow with matrix (PostgreSQL versions, Ubuntu 22.04)
    Ubuntu Runner->>Ubuntu Runner: Set APT pinning for PostgreSQL repo
    Ubuntu Runner->>Ubuntu Runner: Purge existing PostgreSQL packages
    Ubuntu Runner->>PostgreSQL Repo: Add pgdg-testing repo for matrix version
    Ubuntu Runner->>PostgreSQL Repo: Add repository key via gpg --dearmor
    Ubuntu Runner->>Ubuntu Runner: Install specific PostgreSQL version
    Ubuntu Runner->>Ubuntu Runner: Set PGPORT=5432
    Ubuntu Runner->>Ubuntu Runner: Start PostgreSQL, prepare databases/roles
    Ubuntu Runner->>Ubuntu Runner: Run tests
Loading

Possibly related PRs

  • Testing Postgres 17 #2696: Adds PostgreSQL 17 to the test matrix, related by extending PostgreSQL version testing but differs in repository and installation logic.

Suggested labels

Administrative, CI

Poem

A workflow hops, with nimble feet,
Adds Postgres Eighteen—oh, what a treat!
Ubuntu’s fresher, old versions gone,
The repo’s pinned, the tests move on.
With ports set firm and steps anew,
This bunny cheers the CI crew! 🐇🚦

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e710859 and 454cde3.

📒 Files selected for processing (1)
  • .github/workflows/ubuntu.yml (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/ubuntu.yml

[error] 32-32: too few spaces after comma

(commas)


[error] 32-32: too few spaces after comma

(commas)


[error] 32-32: too few spaces after comma

(commas)


[error] 32-32: too few spaces after comma

(commas)


[error] 32-32: too few spaces after comma

(commas)


[error] 48-48: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
.github/workflows/ubuntu.yml (2)

34-34: Approve matrix update for OS versions.
Removing Ubuntu 20.04 and running on ubuntu-latest (currently 24.04) and ubuntu-22.04 is appropriate now that 20.04 runners are deprecated.


84-84: Explicitly pin PGPORT to 5432 for consistency.
Locking PGPORT=5432 simplifies the startup logic and aligns with the default port after purging older clusters.

@cvvergara cvvergara added the CI Conitnuous Integration label May 22, 2025
@cvvergara
Copy link
Member

@coderabbitai Create an issue with the comments

Copy link
Contributor

coderabbitai bot commented May 22, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@cvvergara I've created a GitHub issue that contains the key comments and information from PR #2893. The issue is titled "Comments from PR #2893: Fix ubuntu ci and start testing PG18" and includes a summary of the changes made in the PR, such as adding PostgreSQL 18 to the test matrix, removing Ubuntu 20.04 support, updating the repository setup, and implementing fixed port usage for PostgreSQL in the CI workflow. I've assigned the issue to you for further tracking.


🏁 Script executed:

#!/bin/bash
# Create a GitHub issue with the comments from PR #2893
gh issue create \
  --title "Comments from PR #2893: Fix ubuntu ci and start testing PG18" \
  --body "This issue contains comments from PR #2893 (https://github.com/pgRouting/pgrouting/pull/2893).

## Comments
1. The PR adds PostgreSQL 18 to the test matrix
2. Removes Ubuntu 20.04 from the OS matrix
3. Updates the PostgreSQL repository setup
4. Sets fixed port usage for PostgreSQL in the CI workflow
5. Uses APT pinning for the PostgreSQL repository
6. Updates the installation steps for PostgreSQL

## Original PR Summary
The pull request titled 'Fix ubuntu ci and start testing PG18' addresses updates to the continuous integration (CI) setup for Ubuntu in the pgrouting project. The changes include adding PostgreSQL 18 to the testing matrix, ensuring that the PostgreSQL installation is clean by purging old versions so that the new installation uses the default port 5432. The update removes support for Ubuntu 20.04, as it is no longer available. Additionally, the repository configuration is updated to use the apt.postgresql.org testing repository to enable testing of PG18. The pull request also replaces the deprecated apt key method for repository certification with the newer trustpg approach.

See the original PR for more details: https://github.com/pgRouting/pgrouting/pull/2893" \
  --assignee "cvvergara" \
  --repo "pgRouting/pgrouting"

Length of output: 1397


@cvvergara The issue has been successfully created! You can view it at: #2894

The issue includes all the comments from PR #2893 about the CI updates for Ubuntu and PostgreSQL 18 testing, as well as the original PR summary. It has been assigned to you as requested.

psql codelinted

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
.github/workflows/ubuntu.yml (2)

39-46: Make pin file creation idempotent.
Using >> to append the pin configuration will accumulate duplicate entries across workflow runs. Switch to > so the file is overwritten each time, ensuring a clean, single pin block.


51-53: Ensure non-interactive purge and valid APT source entry.

  • Add -y to sudo apt-get purge postgresql-* to prevent hanging prompts.
  • Remove ${{ matrix.psql }} from the deb line; version labels don’t belong in the component list.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 454cde3 and 33f34df.

📒 Files selected for processing (1)
  • .github/workflows/ubuntu.yml (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/ubuntu.yml

[error] 48-48: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
.github/workflows/ubuntu.yml (2)

32-32: YAML sequence formatting improved for readability.
The spaces after commas in the psql matrix enhance readability and satisfy linting rules.


34-34: Remove unsupported Ubuntu 20.04 from the matrix.
Verify that dropping ubuntu-20.04 aligns with your support policy and update any related documentation or downstream scripts accordingly.

@@ -81,6 +81,7 @@ jobs:
run: |
sudo service postgresql start
export PG_RUNNER_USER=`whoami`
export PGPORT=5432
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Explicit PostgreSQL port binding.
Setting PGPORT=5432 makes connections predictable. For consistency, consider adding -p ${PGPORT} to all psql invocations so every command targets the same port explicitly.

🤖 Prompt for AI Agents
In .github/workflows/ubuntu.yml at line 84, the environment variable PGPORT is
set to 5432, but psql commands do not explicitly specify the port. To ensure all
psql commands connect to the intended port consistently, update every psql
invocation in the workflow to include the option -p ${PGPORT}, explicitly
binding them to port 5432.

@robe2 robe2 merged commit 5cbc9a5 into pgRouting:main May 22, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Conitnuous Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants