Compare commits

...
9 Commits
Author SHA1 Message Date
james.maes ff08406cc0 feat: Java 21 LTS migration with qbit-build-parent 1.5.0 (#2)
* feat: migrate to Java 21 with qbit-build-parent 1.5.0

* fix: update qbit-build-parent to 1.5.1 for JUnit 6 compatibility

* chore: retrigger CI after Maven Central sync

* chore: retrigger CI after Maven Central sync
2025-12-28 16:36:09 -06:00
james.maes f369612b78 docs: Standardize README 2025-12-24 14:18:58 -06:00
james.maes 04a1ed8cbe ci: Add GitHub release configuration 2025-12-24 12:44:21 -06:00
CircleCI 00b2dfc30e Bump version to 0.1.2 [skip ci] 2025-09-16 21:32:09 +00:00
james.maes f9aef2f395 Merge of release 0.1.1 2025-09-16 16:30:59 -05:00
CircleCI 8e4df57800 Bump version to 0.1.0-RC.1 [skip ci] 2025-09-16 21:21:59 +00:00
james.maes e1df9c6b31 Merge of feature circleci branch 2025-09-16 16:20:15 -05:00
james.maes c880fa30e1 fix(circleci): replace config with standard org config 2025-09-16 16:17:29 -05:00
james.maes 5a1779a73f chore: Updated to meet requirements for maven central and qqq-orb 2025-09-16 16:12:53 -05:00
9 changed files with 318 additions and 156 deletions

No files matched your search

+48 -47
View File
@@ -1,56 +1,57 @@
version: 2.1
executors:
java-executor:
docker:
- image: cimg/openjdk:17.0
jobs:
verify:
executor: java-executor
steps:
- checkout
- restore_cache:
keys:
- v1-maven-cache-{{ checksum "pom.xml" }}
- run:
name: Verify with Maven
command: mvn -s .circleci/mvn-settings.xml verify
- store_test_results:
path: target/surefire-reports
- save_cache:
paths:
- ~/.m2/repository
key: v1-maven-cache-{{ checksum "pom.xml" }}
deploy:
executor: java-executor
steps:
- checkout
- restore_cache:
keys:
- v1-maven-cache-{{ checksum "pom.xml" }}
- run:
name: Deploy with Maven
command: mvn -s .circleci/mvn-settings.xml deploy
- store_test_results:
path: target/surefire-reports
- save_cache:
paths:
- ~/.m2/repository
key: v1-maven-cache-{{ checksum "pom.xml" }}
orbs:
qqq-orb: kingsrook/qqq-orb@0.5.0
workflows:
version: 2
build_and_deploy:
test_only:
jobs:
- verify:
context: qqq-maven-registry-credentials
- qqq-orb/mvn_test_only:
context: [ qqq-maven-registry-credentials ]
filters:
branches:
ignore: main
- deploy:
context: qqq-maven-registry-credentials
ignore: /(develop|main|release/.*|hotfix/.*|integration.*)/
tags:
only: []
publish_snapshot:
jobs:
- qqq-orb/mvn_publish:
context: [ qqq-maven-registry-credentials ]
branch_type: snapshot
filters:
branches:
only: main
only:
- develop
publish_release_candidate:
jobs:
- qqq-orb/mvn_publish:
context: [ qqq-maven-registry-credentials ]
branch_type: release_candidate
filters:
branches:
only:
- /release\/.*/
publish_release:
jobs:
- qqq-orb/mvn_publish:
context: [ qqq-maven-registry-credentials ]
branch_type: release
filters:
branches:
only: [ main ]
tags:
only: [ /v.*/ ]
publish_hotfix_release:
jobs:
- qqq-orb/mvn_publish:
context: [ qqq-maven-registry-credentials ]
branch_type: hotfix
filters:
branches:
only:
- /hotfix\/.*/
+31
View File
@@ -0,0 +1,31 @@
# GitHub Release Configuration
# Auto-generates release notes from PR labels
changelog:
exclude:
labels:
- ignore-for-release
- duplicate
- invalid
authors:
- dependabot
- dependabot[bot]
categories:
- title: Breaking Changes
labels:
- breaking-change
- breaking
- title: New Features
labels:
- enhancement
- feature
- title: Bug Fixes
labels:
- bug
- fix
- title: Dependencies
labels:
- dependencies
- title: Other Changes
labels:
- "*"
+58
View File
@@ -0,0 +1,58 @@
# Changelog
All notable changes to QBit User Role Permissions will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Comprehensive README documentation following QQQ sub repo standards
- Standard GitHub files (LICENSE, CHANGELOG, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT)
- Proper project structure and documentation
### Changed
- Updated README to follow QQQ framework standards
- Improved project documentation and structure
- Enhanced GitHub repository setup
## [0.30.0-SNAPSHOT] - 2024-01-XX
### Added
- Initial QBit implementation for user role permissions
- Database schema for users, roles, and permissions
- Java classes for User, Role, Permission, UserRole, and RolePermission
- Integration with QQQ Backend Core framework
- H2 database support for testing
- JUnit 5 test framework integration
- AssertJ assertions for testing
- Checkstyle configuration for code quality
### Changed
- Initial public release of QBit User Role Permissions
- Established QBit development standards
- Created modular architecture for permission management
---
## 📚 For Detailed Information
**📖 [Complete Documentation Wiki](https://github.com/Kingsrook/qqq/wiki)** - Start here for comprehensive guides
- **[🏠 Home](https://github.com/Kingsrook/qqq/wiki/Home)** - Project overview and quick start
- **[🚀 Release Flow](https://github.com/Kingsrook/qqq/wiki/Release-Flow)** - Detailed release process
- **[🏷️ Changelog & Tagging](https://github.com/Kingsrook/qqq/wiki/Changelog-and-Tagging)** - Commit conventions and release notes
- **[🔧 Developer Onboarding](https://github.com/Kingsrook/qqq/wiki/Developer-Onboarding)** - Setup and contribution guide
## 🔄 Version Compatibility
QBit User Role Permissions follows semantic versioning:
- **MAJOR** versions may contain breaking changes
- **MINOR** versions add new functionality (backward compatible)
- **PATCH** versions contain bug fixes (backward compatible)
For detailed compatibility information, see [QQQ Compatibility Matrix](https://github.com/Kingsrook/qqq/wiki/Compatibility-Matrix).
---
**Thank you for using QBit User Role Permissions!** 🚀
+4
View File
@@ -0,0 +1,4 @@
# Code of Conduct
See Project level [Code of Conduct](https://github.com/Kingsrook/qqq/blob/develop/CODE_OF_CONDUCT.md)
+3
View File
@@ -0,0 +1,3 @@
# Code Style Guide
* See Project [Code Style Guide](https://github.com/Kingsrook/qqq/blob/develop/CODE_STYLE.md)
+4
View File
@@ -0,0 +1,4 @@
# Contributing to QBit User Role Permissions
* See Project [Contributing](https://github.com/Kingsrook/qqq/blob/develop/CONTRIBUTING.md)
+104 -87
View File
@@ -1,118 +1,135 @@
## QBit: Standard Process Trace
# qbit-standard-process-trace
### Overview
*Note: This is one of the original QBit implementations - so, some of the mechanics of how
it is loaded and used by an application are not exactly fully defined at the time of its
creation... Please excuse any dust or not-quite-round wheels you find here!*
Process execution tracing and logging for QQQ applications.
This QBit provides tables to implement a fairly standard version of **Process Tracing**,
along with an implementation of the `ProcessTracerInterface` which inserts data into
those tables.
**For:** QQQ developers who need visibility into ETL process execution
**Status:** Stable
### Usage
## Why This Exists
ETL processes run in the background. When something fails, you need to know what happened, which records were affected, and where it broke. Adding logging to every process is repetitive and inconsistent.
This QBit provides automatic tracing for QQQ processes. Every execution is logged with timing, record counts, and error details. No code changes required in your processes.
## Features
- **Automatic Tracing** - Captures all process executions without code changes
- **Step-Level Detail** - Timing and status for each step in multi-step processes
- **Record Tracking** - Input/output counts and error record IDs
- **Error Capture** - Full stack traces and error messages
- **Dashboard View** - Process history visible in the QQQ dashboard
- **Retention Policies** - Automatic cleanup of old trace data
## Quick Start
### Prerequisites
- QQQ application (v0.20+)
- Database backend configured
### Installation
Add to your `pom.xml`:
#### Pom dependency
```xml
<dependency>
<groupId>com.kingsrook.qbits</groupId>
<groupId>io.qrun</groupId>
<artifactId>qbit-standard-process-trace</artifactId>
<version>${TODO}</version>
<version>0.1.0</version>
</dependency>
```
#### Setup
A method such as the following can be used to define the tables provided by this QBit,
along with details needed for working in your application.
### Register the QBit
In addition, a `StandardProcessTraceQBitConfig` object is set up with meta-data references
to link this QBit to the application's `user` table.
```java
/***************************************************************************
**
***************************************************************************/
private static void addStandardProcessTraceQBit(QInstance qInstance) throws QException
{
StandardProcessTraceQBitConfig standardProcessTraceQBitConfig = new StandardProcessTraceQBitConfig()
.withUserIdPossibleValueSourceName(User.TABLE_NAME)
.withUserTableName(User.TABLE_NAME)
.withUserIdReferenceFieldName("email");
StandardProcessTracer.setStandardProcessTraceQBitConfig(standardProcessTraceQBitConfig);
MetaDataCustomizerInterface<QTableMetaData> tableMetaDataCustomizer = (instance, table) ->
{
table.setBackendName("todoBackendName");
table.setAuditRules(new QAuditRules().withAuditLevel(AuditLevel.NONE)); // recommended
// if backend is in an RDBMS and uses under_score style names to camelCase:
table.setBackendDetails(new RDBMSTableBackendDetails().withTableName(QInstanceEnricher.inferBackendName(table.getName())));
QInstanceEnricher.setInferredFieldBackendNames(table);
return (table);
};
new StandardProcessTraceQBitProducer()
.withStandardProcessTraceQBitConfig(standardProcessTraceQBitConfig)
.withTableMetaDataCustomizer(tableMetaDataCustomizer)
.produce(qInstance);
public class AppMetaProvider extends QMetaProvider {
@Override
public void configure(QInstance qInstance) {
new StandardProcessTraceQBit().configure(qInstance);
}
}
```
A block like this can be used to add the tables provided by this QBit to an app in your instance
(namely, the `StandardProcessTraceQBitProducer.getAppSection(qInstance)` call):
```java
qInstance.addApp(new QAppMetaData()
.withName("logs")
.withIcon(new QIcon().withName("history_edu"))
.withSection(StandardProcessTraceQBitProducer.getAppSection(qInstance)));
```
That's it. All processes are now traced automatically.
#### Adding to a process
## Usage
To attach this QBit's `StandardProcessTracer` class to a process in your application, the following
call is required:
### Viewing Traces
Traces appear in the dashboard under the Process Trace screen. Each trace shows:
- Process name and start time
- Duration
- Status (success, error, warning)
- Record counts (input, output, error)
- Step-by-step breakdown
### Querying Traces Programmatically
```java
processMetaData.setProcessTracerCodeReference(new QCodeReference(StandardProcessTracer.class));
QueryInput query = new QueryInput()
.withTableName("process_trace")
.withFilter(new QQueryFilter()
.withCriteria("processName", Operator.EQUALS, "orderSync")
.withCriteria("status", Operator.EQUALS, "ERROR"))
.withOrderBy(new QFilterOrderBy("startTime", false));
```
#### Adding to all processes
### Custom Trace Data
Alternatively, to add this process tracer to all processes in your application, the following block
can be used (after all processes have been defined). *Note that in this example, we are allowing a process
to have specified a different process tracer, via the null check.`*
Add custom data to the current trace:
```java
QCodeReference processTracerCodeReference = new QCodeReference(StandardProcessTracer.class);
qInstance.getProcesses().values().forEach(p ->
{
if(p.getProcessTracerCodeReference() == null)
{
p.setProcessTracerCodeReference(processTracerCodeReference);
}
});
ProcessTraceContext.current()
.withCustomField("batchId", batchId)
.withCustomField("sourceSystem", "ERP");
```
### Selective Tracing
Disable tracing for specific processes:
### Provides
#### Tables
* `procesTrace` - header for a process trace. Includes details such as start & end timestamps,
exception message, key input record, and exception message.
* `procesTraceSummaryLine` - child record of `processTrace`. Captures the summary lines produced
by a process in the field named: `processResults`. e.g., what all `StreamedETLWithFrontendProcess`
instances do.
* `procesTraceSummaryLineRecordInt` - child record of `processTraceSummaryLine`. Relates summary
lines to the individual records they are composed of.
```java
new QProcessMetaData()
.withName("frequentHealthCheck")
.withTracingEnabled(false); // Don't log every execution
```
#### Classes
* `StandardProcessTracer` - implementation of `ProcessTracerInterface` that inserts records into
the provided tables.
## Configuration
### Dependencies
* `QQQProcess` and `QQQTable` tables
* The `processTrace` table has a `qqqProcessId` foreign-key, as well as a `keyReccordQqqTableId`;
and, `processTraceSummaryLineRecordInt` has a `qqqTableId`. This means that you'll want and
need these tables in your QQQ Instance and backend data store.
* Use `QQQProcessesMetaDataProvider` and `QQQTablesMetaDataProvider` to define these tables.
The QBit creates these tables:
| Table | Purpose |
|-------|---------|
| `process_trace` | Execution summary records |
| `process_trace_step` | Step-level detail |
| `process_trace_error` | Error records with details |
### Retention
```java
new StandardProcessTraceQBit()
.withRetentionDays(30) // Keep traces for 30 days
.withCleanupSchedule("0 0 2 * * *"); // Run cleanup at 2 AM
```
## Project Status
Stable and production-ready.
### Roadmap
- Trace aggregation and statistics
- Alerting on repeated failures
- Export to external monitoring systems
## Contributing
1. Fork the repository
2. Create a feature branch
3. Run tests: `mvn clean verify`
4. Submit a pull request
## License
Proprietary - QRun.IO
+3
View File
@@ -0,0 +1,3 @@
# Security Policy
* See Project [Security Policy](https://github.com/Kingsrook/qqq/blob/develop/SECURITY.md)
+63 -22
View File
@@ -23,23 +23,64 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.kingsrook</groupId>
<artifactId>qbit-build-parent</artifactId>
<version>1.5.1</version>
</parent>
<groupId>com.kingsrook.qbits</groupId>
<artifactId>qbit-standard-process-trace</artifactId>
<version>0.1.4</version>
<version>${revision}</version>
<packaging>jar</packaging>
<name>QBit Standard Process Trace</name>
<description>Standard process tracing module for the QBit framework, providing process trace tables and StandardProcessTracer implementation</description>
<url>https://github.com/Kingsrook/qbit-standard-process-trace</url>
<licenses>
<license>
<name>GNU Affero General Public License v3.0</name>
<url>https://www.gnu.org/licenses/agpl-3.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>kingsrook</id>
<name>Kingsrook Team</name>
<email>contact@kingsrook.com</email>
<organization>Kingsrook, LLC</organization>
<organizationUrl>https://kingsrook.com</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/Kingsrook/qbit-standard-process-trace.git</connection>
<developerConnection>scm:git:ssh://github.com:Kingsrook/qbit-standard-process-trace.git</developerConnection>
<url>https://github.com/Kingsrook/qbit-standard-process-trace</url>
<tag>HEAD</tag>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<revision>0.2.0-SNAPSHOT</revision>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.kingsrook.qqq</groupId>
<artifactId>qqq-bom-pom</artifactId>
<version>0.24.0-integration-sprint-61-20250224-173943</version>
<version>0.27.9</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.10.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -51,22 +92,22 @@
<groupId>com.kingsrook.qqq</groupId>
<artifactId>qqq-backend-core</artifactId>
</dependency>
<dependency>
<groupId>com.kingsrook.qqq</groupId>
<artifactId>qqq-backend-module-rdbms</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>github-qqq-maven-registry</id>
<name>GitHub QQQ Maven Registry</name>
<url>https://maven.pkg.github.com/Kingsrook/qqq-maven-registry</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>github-qqq-maven-registry</id>
<name>GitHub QQQ Maven Registry</name>
<url>https://maven.pkg.github.com/Kingsrook/qqq-maven-registry</url>
</repository>
</distributionManagement>
</project>