Skip to content

Conversation

@Dugowitch
Copy link
Contributor

@Dugowitch Dugowitch commented Feb 4, 2026

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Adjust database privileges to allow managers to update additional system patch metadata while providing migration scripts to manage the new permission.

Enhancements:

  • Grant managers update privileges on the system_patch.template_id column.

Build:

  • Bump the schema migration version and add corresponding up/down SQL migration scripts for the new manager privilege.

@jira-linking
Copy link

jira-linking bot commented Feb 4, 2026

Referenced Jiras:
https://issues.redhat.com/browse/RHINENG-21214

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 4, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Extends the manager role’s UPDATE privileges on the system_patch table to include the template_id column, and wires this into the schema versioning via a new migration (144).

ER diagram for system_patch table context in privilege update

erDiagram
    system_patch {
        bigint id PK
        bigint template_id
        int installable_advisory_count_cache
        int applicable_advisory_count_cache
        int applicable_advisory_enh_count_cache
        int applicable_advisory_bug_count_cache
        int applicable_advisory_sec_count_cache
    }

    template {
        bigint id PK
    }

    system_patch }o--|| template : references
Loading

File-Level Changes

Change Details Files
Extend manager role UPDATE permissions on system_patch to include template_id and version it via migration 144.
  • Bump current schema version marker from 143 to 144 in the initial schema creation script.
  • Add template_id to the list of columns that manager can SELECT/UPDATE on the system_patch table in the base schema grants.
  • Introduce an up migration that grants UPDATE on system_patch(template_id) to manager.
  • Introduce a down migration that revokes UPDATE on system_patch(template_id) from manager.
database_admin/schema/create_schema.sql
database_admin/migrations/144_add_manager_update_privilege.up.sql
database_admin/migrations/144_add_manager_update_privilege.down.sql

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.39%. Comparing base (033d6a6) to head (e05c755).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2042   +/-   ##
=======================================
  Coverage   59.39%   59.39%           
=======================================
  Files         134      134           
  Lines        8678     8678           
=======================================
  Hits         5154     5154           
  Misses       2977     2977           
  Partials      547      547           
Flag Coverage Δ
unittests 59.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dugowitch
Copy link
Contributor Author

/retest

1 similar comment
@Dugowitch
Copy link
Contributor Author

/retest

@Dugowitch Dugowitch merged commit 050211d into RedHatInsights:master Feb 5, 2026
8 checks passed
@Dugowitch Dugowitch deleted the fix2 branch February 5, 2026 14:28
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