72 Commits
Author SHA1 Message Date
pnoker 66aab58f20 build: standardize repository tooling and quality gates 2026-09-02 20:51:10 +08:00
pnoker eae86b58fc refactor(storage)!: unify platform persistence on reactive postgresql
- migrate auth, manager, data, and agentic persistence to R2DBC
- hard cut pagination, facade, gateway, web, and CLI contracts
- remove legacy database and TSDB adapters and document validation gates

BREAKING CHANGE: platform persistence now requires PostgreSQL 18 with TimescaleDB and the new reactive API contracts.
2026-09-01 22:03:16 +08:00
pnoker a7ca489b9b style(repo): reformat java, xml, yaml, markdown and frontend sources 2026-08-25 21:27:49 +08:00
pnoker 769d1cb977 style: apply repository-wide formatting
- expand single-line Javadocs to multi-line blocks, rewrap Markdown prose, and reflow POM, YAML, and TypeScript formatting
- formatting only: no Java code lines changed, no build-file semantics changed
- verified: backend compile and check_documentation.py pass, pnpm check and pnpm lint:check pass, and the dc3 YAML files parse
2026-08-25 13:35:00 +08:00
pnoker 0ec9a636b1 docs(backend): complete the Javadoc and comment sweep
- fill the missing Javadoc on public methods, records, and types across the dc3-common, dc3-mq, and dc3-tsdb core modules
- document about 350 public constants and enum constants in dc3-common-constant, including the MCP, RabbitMQ, agentic, manager, auth, and data surfaces
- document exception constructors and replace the lombok @RequiredArgsConstructor with explicit documented constructors in ThreadPoolConfig and QuartzService
- translate the remaining non-English section comments in the TSDB store adapters
- verified: check_documentation.py passes, javadoc doclint=all reports zero warnings across all aggregators, and the touched modules compile
2026-08-25 13:29:16 +08:00
pnoker 51f0efd2d9 style(javadoc): document non-override public methods 2026-08-19 00:05:58 +08:00
pnoker aec6ebfc76 refactor(logging): standardize application logging 2026-08-18 08:14:52 +08:00
hongyuan.zhang 6b37cb5ccd docs(readme): refresh module documentation 2026-08-11 22:58:30 +08:00
pnoker 50c6de9438 docs: rewrap project guides and README files
Prose rewrapping and table reflow from a project-wide markdown pass;
no content changes. Also reverts two formatter mistakes: restores
MD5(password) in dc3-web/AGENTS.md and drops spurious spaces after
CJK punctuation in README.zh.md / README.ja.md.

Covers root guides (AGENTS/CONTRIBUTING/SECURITY/README.*), module
READMEs across dc3-api/center/common/driver/e2e/gateway, the nginx
guide, dc3/doc/{README,TITLE}.md, and dc3-web docs.
2026-08-09 18:44:55 +08:00
pnoker d18bf4d03d style: fix table alignment and whitespace in README files 2026-06-26 13:17:38 +08:00
pnoker 49892923bd docs(common): fix thread and mqtt configuration examples
thread: document the three JDK executor beans and the real dc3.thread
keys (the @Async claim was wrong). mqtt: correct the dc3.driver.mqtt
prefix/keys and the Spring Integration + Paho component roles.
2026-06-22 16:49:19 +08:00
Vickey 918b3d5e8e feat: update pom version to 2026.5.22 2026-05-26 00:30:11 +08:00
Vickey 95a0f363e5 refactor: extract domain magic strings to constants
- Profile names: add 8 profile constants in EnvironmentConstant, update
  8 ActiveProfileConfig classes to reference them, and add missing
  dc3-common-constant dependency in 7 pom.xml files.
- Health checks: extract 6 health check map keys in SystemHealthServiceImpl,
  replace hardcoded "default" tenant with DefaultFlagEnum.
- Entity expiry: extract TICK_BODY constant, fix startup race by using
  @EventListener(ApplicationReadyEvent) instead of @PostConstruct.
- Proxy IP: extract PROXY_IP_HEADERS, UNKNOWN_IP, COMMA constants in
  RequestUtil to eliminate inline proxy header array and magic strings.
2026-05-24 03:53:51 +08:00
pnoker 9007cbc22c style: apply consistent code formatting across all modules and docs 2026-05-22 00:24:22 +08:00
Vickey db14585cb8 refactor: replace manual constructors with @RequiredArgsConstructor
Replace hand-written all-assignment constructors with Lombok
@RequiredArgsConstructor across controllers, services, config classes,
event listeners, and tool classes. No behavioral change.
2026-05-21 23:18:08 +08:00
pnoker 7f5da1a0f8 chore: bump version to 2026.5.18 across all modules 2026-05-18 00:24:22 +08:00
pnoker 994ccba991 docs: update READMEs and project documentation
Refresh module READMEs, AGENTS.md, CONTRIBUTING.md, and dc3/doc/
guides to reflect the unified Dockerfile, consolidated compose stacks,
and updated build instructions.
2026-05-17 19:03:21 +08:00
pnoker 996518186a build: bump version to 2026.5.17
Update parent version and dc3.version from 2026.5.5 to 2026.5.17
across all Maven modules.
2026-05-17 19:01:44 +08:00
pnoker 7c853ac8bc chore: correct @since tag to project inception date
Update @since from 2022.1.0 to 2016.10.1 and @version from 2026.5.5
to 2026.5.17 across all Java source files to reflect the actual
project start date.
2026-05-17 19:01:28 +08:00
pnoker db683533b2 refactor(common): preserve exception causes 2026-05-15 17:27:04 +08:00
pnoker dc8f3de062 refactor(common): consolidate EnvironmentPostProcessor registration
Each common module previously declared its EnvironmentPostProcessor
classes twice — via the new META-INF/spring/...EnvironmentPostProcessor.imports
file *and* via the legacy spring.factories — and decorated the classes
with @Configuration even though Spring Boot loads them through
SpringFactoriesLoader, not through the application context.

Drop the @Configuration noise on every Active*ProfileConfig and on the
Driver / Mqtt / Rabbitmq EnvironmentConfig classes, and delete the
duplicate .imports files in agentic, auth, data, driver, gateway,
manager, mqtt, postgres, quartz, rabbitmq, repository, thread, and web.
The remaining META-INF/spring.factories in each module is the single
registration entry point.
2026-05-15 16:10:53 +08:00
Vickey 2f1253cdec test(infra): cover quartz, mqtt and thread pool wiring
Pin three platform-wide infrastructure modules:

- QuartzServiceTest (8) covers all five public methods of the Quartz
  scheduler facade:
  * createJobWithInterval registers the JobDetail with the supplied
    group/name/class and a SimpleTrigger whose repeatInterval matches
    the requested seconds and repeatCount = REPEAT_INDEFINITELY;
  * createJobWithCron registers a CronTrigger with the supplied
    expression and rejects malformed cron strings;
  * startScheduler / stopScheduler are no-ops once the scheduler has
    been shut down (idempotency requirement during graceful shutdown)
    and the underlying SchedulerException is propagated when the
    scheduler is live so callers can distinguish "broken" from "closed".
- MqttUtilTest (6) covers MqttConnectOptions construction:
  * NONE auth leaves credentials unset even if username/password
    fields are populated (defence-in-depth — config switch wins);
  * USERNAME auth applies credentials only when both fields are
    non-empty; blank username or password is silently dropped (so an
    incomplete deployment does not authenticate as a partial principal);
  * https hostname verification is always disabled — pinning this
    deliberate platform choice so a future refactor cannot silently
    enable it and break TLS termination at the gateway.
- ThreadPoolConfigTest (6) + ThreadPropertiesTest (2) cover the
  three executors used across the platform:
  * ThreadPoolExecutor with corePoolSize / maximumPoolSize from
    properties and queue capacity = 2 * maximumPoolSize;
  * threads are named with the [T] / [VT] / [ST] prefixes that the
    log layout depends on for source-of-task identification;
  * the BlockingRejectedExecutionHandler runs the task in the caller
    thread when both the pool and queue are full — pinning this
    contract because the dropping alternative would silently lose
    point values during a re-registration storm;
  * virtualThreadExecutor really hands out virtual threads (the
    Thread#isVirtual contract) so JDK 21 virtual threads are wired
    correctly in production rather than falling back to platform
    threads;
  * isPoolSizeValid catches misconfiguration where max < core.

Verified locally: 22 cases green across the three modules.
2026-05-13 21:06:46 +08:00
Vickey ca45788d50 style(java): sort imports and remove unused imports across modules 2026-05-10 21:43:57 +08:00
pnoker f5045c7392 fix(config): restore spring.factories for EnvironmentPostProcessor loading
Spring Boot 4.0.6 still loads EnvironmentPostProcessor implementations
via SpringFactoriesLoader from META-INF/spring.factories, not from the
new .imports file. The .imports mechanism only applies to
AutoConfiguration classes.

The previous commit incorrectly deleted all spring.factories files,
which broke profile activation for every service (auth, data, manager,
gateway, etc.). Restore them with only the EnvironmentPostProcessor
entries (EnableAutoConfiguration entries remain removed since those
use AutoConfiguration.imports).
2026-05-10 11:33:04 +08:00
Vickey 50cf4dad62 fix(config): align auto-configuration classes and fix resource leaks for Spring Boot 4.x
Auto-configuration:
- Replace @Configuration with @AutoConfiguration on 21 classes listed
  in AutoConfiguration.imports (InitRunners, topic configs, DalConfig,
  MqttConfig, ThreadPoolConfig, RabbitConfig, ExchangeConfig, etc.)
- Add @AutoConfiguration to ExceptionConfig alongside @RestControllerAdvice

WebFlux fixes:
- Replace getServlet().getContextPath() with getReactive().getContextPath()
  in WebFilterConfig (servlet API in reactive context)
- Remove redundant @EnableWebFlux and @Slf4j from WebFluxConfig
- Replace deprecated customCodecs().registerWithDefaultConfig() with
  defaultCodecs().jacksonJsonEncoder/Decoder()

Driver lifecycle:
- Replace System.exit(1) in DriverRegisterServiceImpl with
  ServiceException to allow Spring graceful shutdown

Resource leaks:
- Wrap FileOutputStream in try-with-resources in DeviceServiceImpl
- Wrap BufferedWriter in try-with-resources in CmdUtil
- Rewrite X509Util.loadCertificateWithPassword with try-with-resources
  and remove dead if/else branches
2026-05-10 11:22:50 +08:00
Vickey ef49880871 refactor(config): migrate from spring.factories to Boot 4.x auto-config and EnvironmentPostProcessor imports
Spring Boot 4.x removed the spring.factories mechanism entirely. The
EnableAutoConfiguration entries were already migrated to
AutoConfiguration.imports, but the EnvironmentPostProcessor
registrations were only in the now-defunct spring.factories, meaning
all profile activation and environment configuration was broken.

- Delete all 15 spring.factories files (dead code in Boot 4.x)
- Create EnvironmentPostProcessor.imports for 12 modules, registering
  16 EnvironmentPostProcessor implementations that were previously
  unreachable
2026-05-10 10:36:49 +08:00
Vickey e0ad85e7b5 fix(deps): replace jakarta.validation-api with spring-boot-starter-validation
The API-only artifact had no runtime implementation, causing
"Bean Validation API is on the classpath but no implementation
could be found" at startup. The starter bundles Hibernate Validator.
2026-05-10 01:48:36 +08:00
pnoker 88614fd79a style(java): expand wildcard imports to explicit imports 2026-05-09 23:50:48 +08:00
pnoker 50c18422d3 refactor(config): standardize dc3 property prefixes 2026-05-09 20:45:22 +08:00
pnoker 95525a84e2 fix(config): harden configuration properties 2026-05-09 20:29:01 +08:00
pnoker 97f6b66fb2 fix(common): harden thread pool conversion and stats 2026-05-09 18:49:51 +08:00
pnoker e47299a327 chore: remove format and format-check targets from Makefile 2026-05-07 23:55:32 +08:00
pnoker db456d61fe style: apply spring-javaformat 0.0.47 and fix checkstyle violations
- Apply Spring Java Format to all 1087 Java source files
- Fix star imports (java.lang.annotation, org.quartz, java.util.concurrent, etc.)
- Fix missing trailing newlines across codebase
- Fix redundant public modifiers on interface methods
- Fix multiple variable declarations
- Fix if-statements missing braces in JsonUtil, RegexUtil, RequestUtil
2026-05-07 16:53:16 +08:00
pnoker 95c40b2387 chore: bump version to 2026.5.5
Roll every pom, per-module README, Spring banner, and @version /
@since javadoc tag from 2026.4.30 to the new 2026.5.5 release line.
2026-05-05 00:56:09 +08:00
pnoker adcb587c32 refactor: change @Component to @Configuration for auto-registered classes
Classes registered in AutoConfiguration.imports should use @Configuration
(not @Component) to follow Spring Boot auto-configuration conventions:
- AuthInitRunner, DataInitRunner, DriverInitRunner, ManagerInitRunner,
  MqttInitRunner, ThreadInitRunner: @Component + @ComponentScan → @Configuration
- QuartzService: @Component → @Configuration
- LogsAspect: @Component → @Configuration (retains @Aspect)
2026-05-01 01:55:44 +08:00
Vickey 200beeaa71 chore: update version to 2026.4.30 in multiple files 2026-04-30 16:06:30 +08:00
pnoker c5a9feeeb9 feat: add .env file for Docker Compose configuration and update usage instructions 2026-04-29 10:27:57 +08:00
pnoker ea17c86387 chore: update version to 2026.4.19 across all modules and adjust branch settings in codeql.yml 2026-04-19 13:45:21 +08:00
pnoker b145389ff2 fix: remove invalid .* glob from @ComponentScan basePackages
Spring's @ComponentScan basePackages takes literal package names, not
glob patterns. The '.*' suffix was invalid and could cause unexpected
scan boundaries. Fixed 8 files:
- RedisInitRunner, ThreadInitRunner, MqttInitRunner, DataInitRunner
- DriverInitRunner, DalConfig, AuthInitRunner, ManagerInitRunner
2026-04-18 01:34:05 +08:00
pnoker d102e18b00 chore: fix inceptionYear and scm connection in all pom.xml
- Fix <inceptionYear> from '2016-2022' to '2016' in 20 pom.xml files
- Fix <scm> connection/developerConnection to use scm:git: prefix in 22 pom.xml files
2026-04-18 01:31:07 +08:00
pnoker e57793ec5f chore: bump version to 2026.4.18.3 and optimize pom.xml dependencies
- Bump all module versions from 2025.11.1 to 2026.4.18.3
- Remove orphaned dc3-common-influx dependency and property from root pom.xml
- Standardize dependency comment style in dc3-common/pom.xml
- Merge gRPC dependency groups into single section in dc3-common-api
- Restructure Spring Integration MQTT and Eclipse Paho groups in dc3-common-mqtt
- Fix incorrect comment 'DC3 Common Exception' to 'DC3 Common Related' in dc3-common-postgres
- Add missing blank line before </dependencies> in dc3-common-driver
- Remove stray blank line in root pom.xml dependencyManagement
2026-04-18 01:05:30 +08:00
Vickey 0adff1532b refactor: replace deprecated EnvironmentPostProcessor imports and update JsonMapper references 2026-02-11 11:56:52 +08:00
Vickey 025a7b348f chore: update copyright headers and minor proto field comments across modules 2026-01-07 15:19:43 +08:00
zzi666 70bd89150a docs(common): add english javadoc to thread pool config, BO, and query classes 2026-01-04 10:08:05 +08:00
zzi666 acbc5cf3a7 feat: add comment 2025-12-31 10:13:07 +08:00
Vickey 0e419bab05 feat: update pom 2025-11-11 13:22:24 +08:00
zzi666 21eaa5da34 refactor: remove unused files, standardize code comments and documentation across modules 2025-10-27 10:15:25 +08:00
zzi666 73fe41091e refactor: standardize descriptions, comments, and documentation across POM files and Protobuf definitions 2025-10-24 20:07:28 +08:00
Vickey a9e8d05631 feat: update version 2025-10-05 17:16:37 +08:00
Vickey 35bee1a858 feat(common): add virtual thread executor bean and switch web module from undertow to netty 2025-09-12 11:38:03 +08:00