Contributing to iDempiere Core

Level: Expert Module: General Foundation 19 min read Lesson 45 of 47

Overview

  • What you’ll learn:
    • How the iDempiere open-source community is organized, including its governance model, communication channels, and contribution processes
    • How to use the GitHub fork-and-pull-request workflow to submit code contributions, and how to follow coding standards and review expectations
    • How to write migration scripts for core changes, participate in community activities, and build a path toward becoming a committer
  • Prerequisites: Lesson 26 — Plugin Development Fundamentals, Lesson 27 — Building Your First Plugin, Git proficiency, Java development experience
  • Estimated reading time: 22 minutes

Introduction

iDempiere is not just a piece of software — it is a community-driven open-source project with contributors from around the world. The platform’s continued evolution depends on people who report bugs, write documentation, submit code improvements, review pull requests, and help other users in forums and mailing lists. Contributing to iDempiere core is one of the most impactful ways to give back to the project and to influence the direction of the platform you depend on.

This lesson guides you through the practical process of contributing to iDempiere — from understanding the community structure and governance model to submitting your first pull request and navigating the review process. Whether your contribution is a one-line bug fix or a major feature, the process and standards described here apply.

The iDempiere Open-Source Community

iDempiere emerged from the ADempiere and Compiere heritage, launching as an independent project in 2012. It adopted OSGi modularity and modern development practices while preserving the comprehensive ERP functionality of its predecessors. The community is diverse, spanning consultants, developers, end users, and organizations across every continent.

Community Principles

  • Meritocracy: Influence in the project is earned through contributions — code, documentation, support, and community building. No individual or company controls the project.
  • Transparency: All decisions, discussions, and code changes happen in public channels (mailing lists, JIRA, GitHub). There are no private back-channel decisions about the project’s direction.
  • Collaboration: The community values constructive collaboration, respectful discussion, and consensus-building. Code reviews are opportunities for learning, not criticism.

Governance Model

iDempiere follows a governance structure with defined roles:

  • PMC (Project Management Committee): The governing body responsible for the strategic direction of the project, release management, and community stewardship. PMC members are experienced contributors who have demonstrated sustained commitment to the project.
  • Committers: Developers with write access to the main repository. Committers can merge pull requests and make direct commits. Committer status is granted by the PMC based on a track record of quality contributions and community participation.
  • Contributors: Anyone who contributes code, documentation, bug reports, or support. Contributors submit changes via pull requests that are reviewed and merged by committers.
  • Users: The broader community of iDempiere users who provide feedback, report issues, and participate in discussions.

GitHub Repository Structure

The iDempiere source code is hosted on GitHub at github.com/idempiere/idempiere. Understanding the repository structure is essential for effective contribution.

Branch Strategy

  • master (or main): The development branch where new features and improvements are merged. This branch represents the next release.
  • release branches: When a release is being prepared, a branch is created from master (e.g., release-11). Only bug fixes are cherry-picked into release branches after the branch is created.

Project Structure

The repository contains multiple Eclipse/OSGi projects organized as a flat collection of directories:

  • org.adempiere.base/: Core business logic, model classes, utilities.
  • org.adempiere.ui.zk/: ZK web interface components.
  • org.adempiere.server/: Server-side processes and schedulers.
  • org.adempiere.report.jasper/: JasperReports integration.
  • org.idempiere.test/: Test framework and test cases.
  • migration/: SQL migration scripts organized by release version.
  • org.adempiere.install/: Installation and setup utilities.

Fork and Pull Request Workflow

iDempiere uses the standard GitHub fork-and-pull-request workflow for contributions. Here is the step-by-step process.

Step 1: Fork the Repository

On GitHub, fork the idempiere/idempiere repository to your own GitHub account. This creates your personal copy where you can work freely without affecting the main repository.

Step 2: Clone and Set Up Your Development Environment

# Clone your fork
git clone https://github.com/YOUR_USERNAME/idempiere.git
cd idempiere

# Add the upstream remote to stay in sync
git remote add upstream https://github.com/idempiere/idempiere.git

# Verify remotes
git remote -v
# origin    https://github.com/YOUR_USERNAME/idempiere.git (fetch)
# origin    https://github.com/YOUR_USERNAME/idempiere.git (push)
# upstream  https://github.com/idempiere/idempiere.git (fetch)
# upstream  https://github.com/idempiere/idempiere.git (push)

Set up your IDE (Eclipse is the standard for iDempiere development) and import the projects according to the setup instructions in the repository’s documentation.

Step 3: Create a Feature Branch

Always work on a dedicated branch, never directly on master:

# Ensure your master is up to date
git checkout master
git pull upstream master

# Create a feature branch with a descriptive name
git checkout -b IDEMPIERE-XXXX-short-description

Name your branch after the JIRA ticket (described below) followed by a short description. This makes it easy to associate branches with issues.

Step 4: Make Your Changes

Implement your fix or feature. Follow the coding standards described later in this lesson. Make focused, cohesive changes — one logical change per pull request. If you are fixing a bug and notice an unrelated issue, address it in a separate pull request.

Step 5: Write Tests

Write automated tests for your changes in the org.idempiere.test project. Tests are required for most contributions and significantly increase the chances of your pull request being accepted. Test both the expected behavior (happy path) and edge cases (error conditions, boundary values).

Step 6: Create Migration Scripts (If Required)

If your change involves database modifications, you must include migration scripts (described in detail later in this lesson).

Step 7: Commit and Push

# Stage your changes
git add -A

# Commit with a meaningful message (see commit message guidelines)
git commit -m "IDEMPIERE-XXXX: Brief description of the change"

# Push to your fork
git push origin IDEMPIERE-XXXX-short-description

Step 8: Create the Pull Request

On GitHub, create a pull request from your feature branch to the idempiere/idempiere master branch. In the pull request description, include:

  • A reference to the JIRA ticket (e.g., “Fixes IDEMPIERE-XXXX”).
  • A clear description of what the change does and why.
  • How to test the change (steps for reviewers to verify).
  • Any migration notes or special considerations.
  • Screenshots if the change affects the UI.

JIRA Issue Tracking

iDempiere uses JIRA for issue tracking. Every code contribution should be associated with a JIRA ticket.

Creating a JIRA Ticket

  1. Navigate to the iDempiere JIRA instance.
  2. Create a new issue with the appropriate type: Bug (for defects), Improvement (for enhancements to existing features), New Feature (for entirely new functionality), or Task (for maintenance and housekeeping).
  3. Provide a clear title and detailed description. For bugs, include steps to reproduce, expected behavior, and actual behavior. For features, describe the use case and proposed solution.
  4. Set the component and version fields appropriately.

Linking PRs to JIRA

Reference the JIRA ticket number in your commit messages and pull request title (e.g., IDEMPIERE-6123: Fix NPE in payment allocation when discount is zero). This creates automatic links between JIRA and GitHub, making it easy for reviewers and future developers to trace the context of any change.

Coding Standards and Conventions

Consistent code style across the project makes the codebase readable, maintainable, and reviewable. Follow these conventions for iDempiere contributions.

Java Coding Standards

  • Formatting: Use tabs for indentation (not spaces). Follow the Eclipse default Java formatter settings used by the project. Configure your IDE to match before making changes — formatting differences create noisy diffs that obscure real changes.
  • Naming: Follow standard Java naming conventions — camelCase for methods and variables, PascalCase for classes, ALL_CAPS for constants. Use descriptive names that convey intent.
  • Comments: Write Javadoc for public methods and classes. Inline comments should explain why, not what — the code itself should be clear enough to show what it does.
  • Null handling: Check for null values defensively, especially when working with database query results and user input. Use Util.isEmpty() for string checks.
  • Logging: Use the CLogger class for logging. Log at appropriate levels — FINE for debugging details, INFO for significant operations, WARNING for recoverable errors, SEVERE for failures.

SQL Standards

  • Use uppercase for SQL keywords (SELECT, FROM, WHERE).
  • Use parameterized queries (prepared statements) — never concatenate user input into SQL strings.
  • Write database-agnostic SQL where possible (compatible with both PostgreSQL and Oracle). If database-specific syntax is required, provide implementations for both databases.

Code Review Process

All contributions go through code review before being merged. Code reviews serve multiple purposes: catching bugs, ensuring code quality, knowledge sharing, and maintaining consistency across the codebase.

What Reviewers Look For

  • Correctness: Does the code do what it claims to do? Are edge cases handled?
  • Testing: Are there adequate tests? Do the tests cover the important scenarios?
  • Style: Does the code follow the project’s coding standards?
  • Performance: Are there potential performance issues (N+1 queries, unnecessary database calls, memory leaks)?
  • Compatibility: Does the change work with both PostgreSQL and Oracle? Does it maintain backward compatibility?
  • Migration: Are migration scripts provided for database changes? Are they correct and idempotent?
  • Security: Are there potential security issues (SQL injection, improper access control, information disclosure)?

Responding to Review Feedback

When reviewers request changes:

  • Respond to every comment — either make the requested change or explain why you disagree (with reasoning).
  • Push additional commits to the same branch (do not force-push, as this makes it hard for reviewers to see what changed).
  • Be patient — reviewers are volunteers contributing their time. Reviews may take days or weeks depending on the complexity and the reviewers’ availability.

How to Write Good Commit Messages

Good commit messages are essential for project history. Follow this format:

IDEMPIERE-XXXX: Short summary of the change (50 chars or less)

Longer description if needed. Explain the motivation for the change,
what problem it solves, and any important design decisions. Wrap
lines at 72 characters.

- Bullet points are acceptable for listing multiple changes
- Reference related tickets if applicable
  • The first line is the subject: start with the JIRA ticket number, followed by a concise summary.
  • Separate the subject from the body with a blank line.
  • Use the imperative mood in the subject (“Fix bug” not “Fixed bug” or “Fixes bug”).
  • The body explains why the change was made, not just what was changed (the diff shows the what).

Migration Scripts for Core Changes

When a contribution includes database changes (new tables, new columns, modified columns, new reference data), migration scripts must be provided. iDempiere uses SQL migration scripts that are executed during the upgrade process.

Migration Script Structure

-- Migration script location:
-- migration/iN.N/postgresql/YYYYMMDDHHMMSS_IDEMPIERE-XXXX.sql

-- Example: Adding a new column to C_BPartner
-- IDEMPIERE-6123 Add preferred communication channel to Business Partner

SELECT register_migration_script('YYYYMMDDHHMMSS') FROM dual;

-- Add column
ALTER TABLE C_BPartner ADD COLUMN PreferredChannel VARCHAR(2) DEFAULT 'EM';

-- Add to Application Dictionary
INSERT INTO AD_Column (AD_Column_ID, AD_Client_ID, AD_Org_ID, IsActive,
    Created, CreatedBy, Updated, UpdatedBy,
    Name, Description, AD_Table_ID, ColumnName, FieldLength,
    AD_Reference_ID, DefaultValue, IsKey, IsParent, IsMandatory,
    IsUpdateable, IsIdentifier, AD_Element_ID)
VALUES (get_next_id('AD_Column'), 0, 0, 'Y',
    now(), 100, now(), 100,
    'Preferred Channel', 'Preferred communication channel',
    291, 'PreferredChannel', 2,
    17, 'EM', 'N', 'N', 'N',
    'Y', 'N', get_next_id('AD_Element'));

-- Provide Oracle version as well
-- migration/iN.N/oracle/YYYYMMDDHHMMSS_IDEMPIERE-XXXX.sql

Migration Script Requirements

  • Provide scripts for both PostgreSQL and Oracle databases.
  • Scripts must be idempotent where possible — running the same script twice should not cause errors (use IF NOT EXISTS clauses, check before insert).
  • Use the correct naming convention: YYYYMMDDHHMMSS_IDEMPIERE-XXXX.sql with the timestamp indicating the creation time.
  • Include Application Dictionary updates (AD_Table, AD_Column, AD_Field, etc.) — do not just modify the database schema.
  • Register the migration script with register_migration_script() so the system knows which scripts have been applied.

Testing Requirements for Contributions

The iDempiere project maintains a test suite in the org.idempiere.test bundle. Contributions should include tests whenever possible.

Writing Tests

// Example: Test for a bug fix in payment allocation
public class PaymentAllocationTest extends AbstractTestCase {

    @Test
    public void testAllocationWithZeroDiscount() {
        // Set up test data
        MBPartner bp = new MBPartner(Env.getCtx(), 0, getTrxName());
        bp.setName("Test Partner");
        bp.setIsCustomer(true);
        bp.saveEx();

        // Create and complete an invoice
        MInvoice invoice = createTestInvoice(bp, new BigDecimal("100.00"));
        completeDocument(invoice);

        // Create allocation with zero discount (the bug scenario)
        MAllocationHdr alloc = new MAllocationHdr(Env.getCtx(), true,
            Env.getContextAsDate(Env.getCtx(), "#Date"),
            116, "Test allocation", getTrxName());
        alloc.saveEx();

        MAllocationLine line = new MAllocationLine(alloc,
            new BigDecimal("100.00"),
            BigDecimal.ZERO,  // Zero discount - previously caused NPE
            BigDecimal.ZERO,
            BigDecimal.ZERO);
        line.setC_Invoice_ID(invoice.get_ID());
        line.saveEx();

        // This should not throw NPE (the fix)
        String result = alloc.completeIt();
        assertEquals(DocAction.STATUS_Completed, result);
        assertEquals(BigDecimal.ZERO, invoice.getOpenAmt());
    }
}

Community Communication

Active participation in community communication channels is essential for effective contribution.

Mailing Lists

The iDempiere mailing lists on Google Groups are the primary communication channels:

  • idempiere-developers: Technical discussions about code, architecture, and development practices.
  • idempiere-users: Functional discussions, user support, and implementation questions.

Forums and Wiki

The iDempiere wiki contains documentation, how-to guides, and architectural notes. Contributing to documentation is just as valuable as contributing code — perhaps more so, as good documentation helps many more people than a single bug fix.

iDempiere Conference

The annual iDempiere World Conference brings the community together for presentations, workshops, and networking. Attending (or presenting at) the conference is an excellent way to deepen your involvement and build relationships with other community members.

Becoming a Committer

Committer status is granted by the PMC based on demonstrated merit. There is no fixed checklist, but the following behaviors increase your chances:

  • Consistent contributions: Regular, quality contributions over an extended period (months to years) demonstrate sustained commitment.
  • Code quality: Submissions that consistently pass review with minimal changes demonstrate technical maturity.
  • Community participation: Active participation in discussions, helping other users, reviewing pull requests, and contributing documentation.
  • Domain expertise: Deep knowledge of specific areas of iDempiere (e.g., accounting engine, manufacturing, reporting) that makes your reviews and contributions particularly valuable.
  • Reliability: Following through on commitments, responding to review feedback promptly, and being a dependable community member.

Intellectual Property and License

iDempiere is licensed under the GNU General Public License version 2 (GPLv2). When you contribute code to iDempiere, you are agreeing that your contribution will be distributed under this license.

Key License Considerations

  • Copyleft: GPLv2 requires that derivative works also be distributed under GPLv2. If you modify iDempiere core code, your modifications must be open-sourced under the same license.
  • Plugin exception: Plugins that interact with iDempiere through its public APIs and extension points (OSGi services, model validators, callouts) are generally considered separate works and can be distributed under different licenses. This is a critical distinction for commercial plugin developers.
  • Contributor agreement: Ensure that you have the right to contribute the code you submit. If you are employed, your employer may have IP claims on code you write. Clarify this before contributing.
  • Third-party code: Do not include code from other projects unless its license is compatible with GPLv2. Document the source and license of any third-party code included in your contribution.

Summary

Contributing to iDempiere is a rewarding way to improve the platform you depend on, build your professional reputation, and participate in a global open-source community. The key steps are:

  • Create a JIRA ticket for your change.
  • Fork the repository, create a feature branch, and implement your change following coding standards.
  • Write tests and migration scripts as needed.
  • Submit a pull request with a clear description and JIRA reference.
  • Respond constructively to code review feedback.
  • Participate in community discussions beyond just code contributions.

In the next lesson, we will explore real-world iDempiere deployments through case studies — learning from the successes and challenges of enterprise implementations across different industries.

繁體中文翻譯

概述

  • 學習內容:
    • iDempiere 開源社群的組織方式,包括其治理模型、溝通管道和貢獻流程
    • 如何使用 GitHub 的 fork-and-pull-request 工作流程提交程式碼貢獻,以及如何遵循程式碼標準和審查期望
    • 如何為核心變更撰寫遷移腳本、參與社群活動,並邁向成為 Committer 的道路
  • 先備知識:第 26 課 — 外掛開發基礎、第 27 課 — 建構您的第一個外掛、Git 精通、Java 開發經驗
  • 預估閱讀時間:22 分鐘

簡介

iDempiere 不僅僅是一套軟體 — 它是一個由全球貢獻者驅動的社群開源專案。平台的持續演進依賴於報告錯誤、撰寫文件、提交程式碼改進、審查 Pull Request,以及在論壇和郵件列表中幫助其他使用者的人們。貢獻 iDempiere 核心是回饋專案並影響您所依賴平台方向的最具影響力方式之一。

本課引導您完成貢獻 iDempiere 的實務流程 — 從了解社群結構和治理模型到提交您的第一個 Pull Request 並通過審查流程。無論您的貢獻是一行錯誤修正還是重大功能,這裡描述的流程和標準都適用。

iDempiere 開源社群

iDempiere 從 ADempiere 和 Compiere 的傳承中誕生,於 2012 年作為獨立專案啟動。它採用了 OSGi 模組化和現代開發實務,同時保留了前身全面的 ERP 功能。社群多元化,涵蓋顧問、開發者、終端使用者和遍佈各大洲的組織。

社群原則

  • 精英制度:在專案中的影響力透過貢獻贏得 — 程式碼、文件、支援和社群建設。沒有個人或公司控制專案。
  • 透明度:所有決策、討論和程式碼變更都在公開管道(郵件列表、JIRA、GitHub)中進行。沒有關於專案方向的私下決策。
  • 協作:社群重視建設性的協作、尊重的討論和共識建立。程式碼審查是學習的機會,而非批評。

治理模型

iDempiere 遵循具有定義角色的治理結構:

  • PMC(專案管理委員會):負責專案戰略方向、版本管理和社群管理的治理機構。PMC 成員是展現了對專案持續承諾的經驗豐富的貢獻者。
  • Committers:擁有主儲存庫寫入權限的開發者。Committers 可以合併 Pull Request 並直接提交。Committer 身份由 PMC 根據品質貢獻和社群參與的記錄授予。
  • Contributors:任何貢獻程式碼、文件、錯誤報告或支援的人。Contributors 透過 Pull Request 提交變更,由 Committers 審查和合併。
  • Users:更廣泛的 iDempiere 使用者社群,他們提供回饋、報告問題並參與討論。

GitHub 儲存庫結構

iDempiere 原始碼託管在 GitHub 上,位於 github.com/idempiere/idempiere。了解儲存庫結構對有效貢獻至關重要。

分支策略

  • master(或 main):開發分支,新功能和改進在此合併。此分支代表下一個版本。
  • release 分支:準備發佈時,從 master 建立分支(例如 release-11)。分支建立後,只有錯誤修正會被 cherry-pick 到 release 分支。

專案結構

儲存庫包含多個 Eclipse/OSGi 專案,組織為扁平的目錄集合:

  • org.adempiere.base/:核心業務邏輯、模型類別、工具程式。
  • org.adempiere.ui.zk/:ZK Web 介面元件。
  • org.adempiere.server/:伺服器端流程和排程器。
  • org.adempiere.report.jasper/:JasperReports 整合。
  • org.idempiere.test/:測試框架和測試案例。
  • migration/:按版本組織的 SQL 遷移腳本。
  • org.adempiere.install/:安裝和設定工具程式。

Fork 和 Pull Request 工作流程

iDempiere 使用標準的 GitHub fork-and-pull-request 工作流程進行貢獻。以下是逐步流程。

步驟 1:Fork 儲存庫

在 GitHub 上,將 idempiere/idempiere 儲存庫 fork 到您自己的 GitHub 帳號。這會建立您的個人副本,您可以自由工作而不影響主儲存庫。

步驟 2:Clone 並設定開發環境

# Clone 您的 fork
git clone https://github.com/YOUR_USERNAME/idempiere.git
cd idempiere

# 新增 upstream remote 以保持同步
git remote add upstream https://github.com/idempiere/idempiere.git

# 驗證 remotes
git remote -v
# origin    https://github.com/YOUR_USERNAME/idempiere.git (fetch)
# origin    https://github.com/YOUR_USERNAME/idempiere.git (push)
# upstream  https://github.com/idempiere/idempiere.git (fetch)
# upstream  https://github.com/idempiere/idempiere.git (push)

設定您的 IDE(Eclipse 是 iDempiere 開發的標準),並根據儲存庫文件中的設定說明匯入專案。

步驟 3:建立功能分支

始終在專用分支上工作,永遠不要直接在 master 上:

# 確保您的 master 是最新的
git checkout master
git pull upstream master

# 建立描述性名稱的功能分支
git checkout -b IDEMPIERE-XXXX-short-description

以 JIRA 工單(如下所述)加上簡短描述為分支命名。這使得分支與問題的關聯變得容易。

步驟 4:進行變更

實作您的修正或功能。遵循本課稍後描述的程式碼標準。進行集中、連貫的變更 — 每個 Pull Request 一個邏輯變更。如果您在修正錯誤時注意到一個不相關的問題,請在單獨的 Pull Request 中處理。

步驟 5:撰寫測試

org.idempiere.test 專案中為您的變更撰寫自動化測試。大多數貢獻都需要測試,測試會顯著增加您的 Pull Request 被接受的機會。測試預期行為(正常路徑)和邊界案例(錯誤條件、邊界值)。

步驟 6:建立遷移腳本(如需要)

如果您的變更涉及資料庫修改,您必須包含遷移腳本(在本課稍後詳細描述)。

步驟 7:提交和推送

# 暫存您的變更
git add -A

# 使用有意義的訊息提交(見提交訊息指南)
git commit -m "IDEMPIERE-XXXX: Brief description of the change"

# 推送到您的 fork
git push origin IDEMPIERE-XXXX-short-description

步驟 8:建立 Pull Request

在 GitHub 上,從您的功能分支向 idempiere/idempiere master 分支建立 Pull Request。在 Pull Request 描述中,包含:

  • JIRA 工單參照(例如「Fixes IDEMPIERE-XXXX」)。
  • 清楚描述變更做了什麼以及為什麼。
  • 如何測試變更(供審查者驗證的步驟)。
  • 任何遷移注意事項或特殊考量。
  • 如果變更影響 UI,則包含螢幕截圖。

JIRA 問題追蹤

iDempiere 使用 JIRA 進行問題追蹤。每個程式碼貢獻都應關聯一個 JIRA 工單。

建立 JIRA 工單

  1. 瀏覽至 iDempiere JIRA 實例。
  2. 以適當的類型建立新問題:Bug(缺陷)、Improvement(現有功能的增強)、New Feature(全新功能)或 Task(維護和整理)。
  3. 提供清楚的標題和詳細描述。對於錯誤,包含重現步驟、預期行為和實際行為。對於功能,描述使用情境和建議的解決方案。
  4. 適當設定元件和版本欄位。

將 PR 連結到 JIRA

在您的提交訊息和 Pull Request 標題中引用 JIRA 工單號碼(例如 IDEMPIERE-6123: Fix NPE in payment allocation when discount is zero)。這會在 JIRA 和 GitHub 之間建立自動連結,使審查者和未來的開發者能夠輕鬆追溯任何變更的背景。

程式碼標準和慣例

整個專案一致的程式碼風格使程式碼庫可讀、可維護和可審查。遵循以下 iDempiere 貢獻慣例。

Java 程式碼標準

  • 格式化:使用 Tab 進行縮排(非空格)。遵循專案使用的 Eclipse 預設 Java 格式化設定。在進行變更前設定您的 IDE 以匹配 — 格式差異會產生嘈雜的差異對比,模糊真正的變更。
  • 命名:遵循標準 Java 命名慣例 — 方法和變數使用 camelCase,類別使用 PascalCase,常數使用 ALL_CAPS。使用傳達意圖的描述性名稱。
  • 註解:為公開方法和類別撰寫 Javadoc。行內註解應解釋為什麼,而非什麼 — 程式碼本身應足夠清晰以顯示它做了什麼。
  • Null 處理:防禦性地檢查 null 值,特別是在處理資料庫查詢結果和使用者輸入時。使用 Util.isEmpty() 進行字串檢查。
  • 日誌記錄:使用 CLogger 類別進行日誌記錄。使用適當的層級記錄 — FINE 用於除錯詳情、INFO 用於重要操作、WARNING 用於可恢復的錯誤、SEVERE 用於失敗。

SQL 標準

  • SQL 關鍵字使用大寫(SELECTFROMWHERE)。
  • 使用參數化查詢(預備語句)— 永遠不要將使用者輸入串接到 SQL 字串中。
  • 盡可能撰寫與資料庫無關的 SQL(同時相容 PostgreSQL 和 Oracle)。如果需要特定資料庫的語法,請為兩個資料庫提供實作。

程式碼審查流程

所有貢獻在合併前都會經過程式碼審查。程式碼審查有多重目的:發現錯誤、確保程式碼品質、知識分享,以及維護程式碼庫的一致性。

審查者關注的事項

  • 正確性:程式碼是否做了它聲稱要做的事?邊界案例是否已處理?
  • 測試:是否有充分的測試?測試是否涵蓋重要的情境?
  • 風格:程式碼是否遵循專案的程式碼標準?
  • 效能:是否有潛在的效能問題(N+1 查詢、不必要的資料庫呼叫、記憶體洩漏)?
  • 相容性:變更是否同時適用於 PostgreSQL 和 Oracle?是否保持向後相容性?
  • 遷移:資料庫變更是否提供了遷移腳本?它們是否正確且具冪等性?
  • 安全性:是否有潛在的安全問題(SQL 注入、不當的存取控制、資訊洩露)?

回應審查回饋

當審查者要求變更時:

  • 回應每條評論 — 進行要求的變更或解釋為什麼不同意(附理由)。
  • 將額外的提交推送到同一分支(不要 force-push,因為這會讓審查者難以看到變更了什麼)。
  • 保持耐心 — 審查者是自願貢獻時間的志工。根據複雜度和審查者的可用性,審查可能需要數天或數週。

如何撰寫好的提交訊息

好的提交訊息對專案歷史至關重要。遵循以下格式:

IDEMPIERE-XXXX: Short summary of the change (50 chars or less)

Longer description if needed. Explain the motivation for the change,
what problem it solves, and any important design decisions. Wrap
lines at 72 characters.

- Bullet points are acceptable for listing multiple changes
- Reference related tickets if applicable
  • 第一行是主題:以 JIRA 工單號碼開頭,後面接簡潔的摘要。
  • 用空行將主題與內文分隔。
  • 在主題中使用祈使語氣(「Fix bug」而非「Fixed bug」或「Fixes bug」)。
  • 內文解釋為什麼進行變更,而不僅僅是什麼被變更(差異對比顯示什麼被變更了)。

核心變更的遷移腳本

當貢獻包含資料庫變更(新表、新欄位、修改欄位、新參考資料)時,必須提供遷移腳本。iDempiere 使用在升級過程中執行的 SQL 遷移腳本。

遷移腳本結構

-- 遷移腳本位置:
-- migration/iN.N/postgresql/YYYYMMDDHHMMSS_IDEMPIERE-XXXX.sql

-- 範例:向 C_BPartner 新增欄位
-- IDEMPIERE-6123 Add preferred communication channel to Business Partner

SELECT register_migration_script('YYYYMMDDHHMMSS') FROM dual;

-- 新增欄位
ALTER TABLE C_BPartner ADD COLUMN PreferredChannel VARCHAR(2) DEFAULT 'EM';

-- 新增至 Application Dictionary
INSERT INTO AD_Column (AD_Column_ID, AD_Client_ID, AD_Org_ID, IsActive,
    Created, CreatedBy, Updated, UpdatedBy,
    Name, Description, AD_Table_ID, ColumnName, FieldLength,
    AD_Reference_ID, DefaultValue, IsKey, IsParent, IsMandatory,
    IsUpdateable, IsIdentifier, AD_Element_ID)
VALUES (get_next_id('AD_Column'), 0, 0, 'Y',
    now(), 100, now(), 100,
    'Preferred Channel', 'Preferred communication channel',
    291, 'PreferredChannel', 2,
    17, 'EM', 'N', 'N', 'N',
    'Y', 'N', get_next_id('AD_Element'));

-- 也提供 Oracle 版本
-- migration/iN.N/oracle/YYYYMMDDHHMMSS_IDEMPIERE-XXXX.sql

遷移腳本要求

  • 為 PostgreSQL 和 Oracle 資料庫提供腳本。
  • 腳本應盡可能具冪等性 — 執行同一腳本兩次不應產生錯誤(使用 IF NOT EXISTS 子句,插入前檢查)。
  • 使用正確的命名慣例:YYYYMMDDHHMMSS_IDEMPIERE-XXXX.sql,時間戳記表示建立時間。
  • 包含 Application Dictionary 更新(AD_Table、AD_Column、AD_Field 等)— 不要僅修改資料庫架構。
  • 使用 register_migration_script() 註冊遷移腳本,讓系統知道已套用了哪些腳本。

貢獻的測試要求

iDempiere 專案在 org.idempiere.test 套件中維護測試套件。貢獻應盡可能包含測試。

撰寫測試

// 範例:付款配置錯誤修正的測試
public class PaymentAllocationTest extends AbstractTestCase {

    @Test
    public void testAllocationWithZeroDiscount() {
        // 設定測試資料
        MBPartner bp = new MBPartner(Env.getCtx(), 0, getTrxName());
        bp.setName("Test Partner");
        bp.setIsCustomer(true);
        bp.saveEx();

        // 建立並完成發票
        MInvoice invoice = createTestInvoice(bp, new BigDecimal("100.00"));
        completeDocument(invoice);

        // 建立折扣為零的配置(錯誤情境)
        MAllocationHdr alloc = new MAllocationHdr(Env.getCtx(), true,
            Env.getContextAsDate(Env.getCtx(), "#Date"),
            116, "Test allocation", getTrxName());
        alloc.saveEx();

        MAllocationLine line = new MAllocationLine(alloc,
            new BigDecimal("100.00"),
            BigDecimal.ZERO,  // 零折扣 - 之前導致 NPE
            BigDecimal.ZERO,
            BigDecimal.ZERO);
        line.setC_Invoice_ID(invoice.get_ID());
        line.saveEx();

        // 這不應拋出 NPE(修正)
        String result = alloc.completeIt();
        assertEquals(DocAction.STATUS_Completed, result);
        assertEquals(BigDecimal.ZERO, invoice.getOpenAmt());
    }
}

社群溝通

積極參與社群溝通管道對有效貢獻至關重要。

郵件列表

Google Groups 上的 iDempiere 郵件列表是主要溝通管道:

  • idempiere-developers:關於程式碼、架構和開發實務的技術討論。
  • idempiere-users:功能討論、使用者支援和導入問題。

論壇和 Wiki

iDempiere wiki 包含文件、操作指南和架構筆記。貢獻文件與貢獻程式碼同樣有價值 — 甚至可能更有價值,因為好的文件比單一的錯誤修正幫助更多的人。

iDempiere 大會

一年一度的 iDempiere 世界大會將社群聚集在一起,進行演講、工作坊和交流。參加(或在大會上發表演講)是加深您參與和與其他社群成員建立關係的絕佳方式。

成為 Committer

Committer 身份由 PMC 根據展現的貢獻授予。沒有固定的清單,但以下行為會增加您的機會:

  • 持續貢獻:在較長時期(數月至數年)內定期、高品質的貢獻展現了持續的承諾。
  • 程式碼品質:一致地以最少的變更通過審查的提交展現了技術成熟度。
  • 社群參與:積極參與討論、幫助其他使用者、審查 Pull Request 和貢獻文件。
  • 領域專業知識:對 iDempiere 特定領域(例如會計引擎、製造、報表)的深入知識使您的審查和貢獻特別有價值。
  • 可靠性:履行承諾、及時回應審查回饋,以及成為可靠的社群成員。

智慧財產權和授權

iDempiere 在 GNU 通用公共授權條款第 2 版(GPLv2)下授權。當您向 iDempiere 貢獻程式碼時,即表示同意您的貢獻將在此授權條款下散佈。

關鍵授權考量

  • Copyleft:GPLv2 要求衍生作品也必須在 GPLv2 下散佈。如果您修改 iDempiere 核心程式碼,您的修改必須在相同的授權條款下開源。
  • 外掛例外:透過 iDempiere 的公開 API 和擴展點(OSGi 服務、模型驗證器、Callout)互動的外掛通常被視為獨立作品,可以在不同的授權條款下散佈。這是商業外掛開發者的關鍵區別。
  • 貢獻者協議:確保您有權貢獻所提交的程式碼。如果您受雇,您的雇主可能對您撰寫的程式碼擁有智慧財產權主張。在貢獻前釐清此事。
  • 第三方程式碼:除非其授權條款與 GPLv2 相容,否則不要包含來自其他專案的程式碼。記錄貢獻中包含的任何第三方程式碼的來源和授權條款。

總結

貢獻 iDempiere 是改善您所依賴平台、建立專業聲譽,以及參與全球開源社群的有價值方式。關鍵步驟是:

  • 為您的變更建立 JIRA 工單。
  • Fork 儲存庫、建立功能分支,並遵循程式碼標準實作變更。
  • 根據需要撰寫測試和遷移腳本。
  • 提交帶有清楚描述和 JIRA 參照的 Pull Request。
  • 建設性地回應程式碼審查回饋。
  • 在程式碼貢獻之外參與社群討論。

在下一課中,我們將透過案例研究探索真實世界的 iDempiere 部署 — 從不同產業的企業導入的成功和挑戰中學習。

日本語翻訳

概要

  • 学習内容:
    • iDempiere オープンソースコミュニティの組織構造(ガバナンスモデル、コミュニケーションチャネル、貢献プロセスを含む)
    • GitHub の fork-and-pull-request ワークフローを使用してコード貢献を提出する方法、およびコーディング標準とレビュー基準の遵守方法
    • コア変更用の移行スクリプトの作成方法、コミュニティ活動への参加方法、コミッターへの道筋の構築方法
  • 前提知識:レッスン 26 — プラグイン開発の基礎、レッスン 27 — 最初のプラグインの構築、Git の習熟、Java 開発経験
  • 推定読了時間:22 分

はじめに

iDempiere は単なるソフトウェアではありません — 世界中の貢献者によって推進されるコミュニティ駆動型のオープンソースプロジェクトです。プラットフォームの継続的な進化は、バグを報告し、ドキュメントを書き、コードの改善を提出し、Pull Request をレビューし、フォーラムやメーリングリストで他のユーザーを支援する人々に依存しています。iDempiere コアへの貢献は、プロジェクトに還元し、依存するプラットフォームの方向性に影響を与える最もインパクトのある方法の一つです。

このレッスンでは、iDempiere への貢献の実践的なプロセスをガイドします — コミュニティ構造とガバナンスモデルの理解から、最初の Pull Request の提出とレビュープロセスのナビゲーションまで。貢献が 1 行のバグ修正であれ、大規模な機能であれ、ここで説明するプロセスと標準は適用されます。

iDempiere オープンソースコミュニティ

iDempiere は ADempiere と Compiere の遺産から生まれ、2012 年に独立プロジェクトとして発足しました。前身の包括的な ERP 機能を維持しながら、OSGi モジュラリティとモダンな開発プラクティスを採用しました。コミュニティは多様で、コンサルタント、開発者、エンドユーザー、そしてすべての大陸の組織にまたがっています。

コミュニティの原則

  • 実力主義:プロジェクトにおける影響力は貢献によって得られます — コード、ドキュメント、サポート、コミュニティ構築。個人や企業がプロジェクトを支配することはありません。
  • 透明性:すべての決定、議論、コード変更は公開チャネル(メーリングリスト、JIRA、GitHub)で行われます。プロジェクトの方向性に関するプライベートな裏チャネルの決定はありません。
  • 協力:コミュニティは建設的な協力、敬意ある議論、合意形成を重視します。コードレビューは批判ではなく学習の機会です。

ガバナンスモデル

iDempiere は定義された役割を持つガバナンス構造に従います:

  • PMC(プロジェクト管理委員会):プロジェクトの戦略的方向性、リリース管理、コミュニティのスチュワードシップを担当する運営機関。PMC メンバーはプロジェクトへの持続的なコミットメントを示した経験豊富な貢献者です。
  • コミッター:メインリポジトリへの書き込みアクセス権を持つ開発者。コミッターは Pull Request をマージし、直接コミットできます。コミッターのステータスは、品質の高い貢献とコミュニティ参加の実績に基づいて PMC から付与されます。
  • コントリビューター:コード、ドキュメント、バグ報告、サポートを貢献するすべての人。コントリビューターはコミッターによってレビュー・マージされる Pull Request を通じて変更を提出します。
  • ユーザー:フィードバックを提供し、問題を報告し、議論に参加する iDempiere ユーザーの幅広いコミュニティ。

GitHub リポジトリ構造

iDempiere のソースコードは GitHub の github.com/idempiere/idempiere でホストされています。効果的な貢献のためにリポジトリ構造を理解することが不可欠です。

ブランチ戦略

  • master(または main):新機能と改善がマージされる開発ブランチ。このブランチは次のリリースを表します。
  • release ブランチ:リリースの準備時に master からブランチが作成されます(例:release-11)。ブランチ作成後は、バグ修正のみが release ブランチに cherry-pick されます。

プロジェクト構造

リポジトリには、フラットなディレクトリコレクションとして構成された複数の Eclipse/OSGi プロジェクトが含まれています:

  • org.adempiere.base/:コアビジネスロジック、モデルクラス、ユーティリティ。
  • org.adempiere.ui.zk/:ZK Web インターフェースコンポーネント。
  • org.adempiere.server/:サーバーサイドプロセスとスケジューラー。
  • org.adempiere.report.jasper/:JasperReports 統合。
  • org.idempiere.test/:テストフレームワークとテストケース。
  • migration/:リリースバージョン別に整理された SQL 移行スクリプト。
  • org.adempiere.install/:インストールとセットアップのユーティリティ。

Fork と Pull Request のワークフロー

iDempiere は貢献に標準的な GitHub の fork-and-pull-request ワークフローを使用しています。以下はステップバイステップのプロセスです。

ステップ 1:リポジトリをフォーク

GitHub で idempiere/idempiere リポジトリを自分の GitHub アカウントにフォークします。これにより、メインリポジトリに影響を与えずに自由に作業できる個人コピーが作成されます。

ステップ 2:クローンして開発環境をセットアップ

# フォークをクローン
git clone https://github.com/YOUR_USERNAME/idempiere.git
cd idempiere

# 同期を保つために upstream リモートを追加
git remote add upstream https://github.com/idempiere/idempiere.git

# リモートを確認
git remote -v
# origin    https://github.com/YOUR_USERNAME/idempiere.git (fetch)
# origin    https://github.com/YOUR_USERNAME/idempiere.git (push)
# upstream  https://github.com/idempiere/idempiere.git (fetch)
# upstream  https://github.com/idempiere/idempiere.git (push)

IDE をセットアップし(Eclipse が iDempiere 開発の標準)、リポジトリのドキュメントのセットアップ手順に従ってプロジェクトをインポートします。

ステップ 3:フィーチャーブランチを作成

常に専用ブランチで作業し、master で直接作業しないでください:

# master が最新であることを確認
git checkout master
git pull upstream master

# 説明的な名前のフィーチャーブランチを作成
git checkout -b IDEMPIERE-XXXX-short-description

ブランチ名は JIRA チケット(後述)に短い説明を付けて命名します。これにより、ブランチと課題の関連付けが容易になります。

ステップ 4:変更を実装

修正または機能を実装します。このレッスンの後半で説明するコーディング標準に従います。焦点を絞った一貫性のある変更を行います — Pull Request ごとに 1 つの論理的な変更。バグを修正中に無関係な問題に気づいた場合は、別の Pull Request で対処します。

ステップ 5:テストを書く

org.idempiere.test プロジェクトで変更の自動テストを作成します。ほとんどの貢献でテストは必須であり、Pull Request が承認される可能性が大幅に高まります。期待される動作(正常パス)とエッジケース(エラー条件、境界値)の両方をテストします。

ステップ 6:移行スクリプトの作成(必要な場合)

変更にデータベースの変更が含まれる場合、移行スクリプトを含める必要があります(このレッスンの後半で詳述)。

ステップ 7:コミットとプッシュ

# 変更をステージング
git add -A

# 意味のあるメッセージでコミット(コミットメッセージガイドライン参照)
git commit -m "IDEMPIERE-XXXX: Brief description of the change"

# フォークにプッシュ
git push origin IDEMPIERE-XXXX-short-description

ステップ 8:Pull Request を作成

GitHub で、フィーチャーブランチから idempiere/idempiere の master ブランチへの Pull Request を作成します。Pull Request の説明には以下を含めます:

  • JIRA チケットへの参照(例:「Fixes IDEMPIERE-XXXX」)。
  • 変更が何をし、なぜ必要かの明確な説明。
  • 変更のテスト方法(レビュアーが検証するための手順)。
  • 移行に関する注意事項や特別な考慮事項。
  • 変更が UI に影響する場合はスクリーンショット。

JIRA 課題追跡

iDempiere は課題追跡に JIRA を使用しています。すべてのコード貢献は JIRA チケットに関連付けられるべきです。

JIRA チケットの作成

  1. iDempiere の JIRA インスタンスに移動します。
  2. 適切なタイプで新しい課題を作成します:Bug(不具合)、Improvement(既存機能の強化)、New Feature(完全に新しい機能)、または Task(メンテナンスとハウスキーピング)。
  3. 明確なタイトルと詳細な説明を提供します。バグの場合は、再現手順、期待される動作、実際の動作を含めます。機能の場合は、ユースケースと提案するソリューションを説明します。
  4. コンポーネントとバージョンフィールドを適切に設定します。

PR と JIRA のリンク

コミットメッセージと Pull Request タイトルで JIRA チケット番号を参照します(例:IDEMPIERE-6123: Fix NPE in payment allocation when discount is zero)。これにより JIRA と GitHub 間の自動リンクが作成され、レビュアーと将来の開発者がすべての変更のコンテキストを容易に追跡できます。

コーディング標準と規約

プロジェクト全体で一貫したコードスタイルにより、コードベースが読みやすく、保守しやすく、レビューしやすくなります。iDempiere への貢献では以下の規約に従います。

Java コーディング標準

  • フォーマット:インデントにはタブを使用します(スペースではなく)。プロジェクトで使用されている Eclipse のデフォルト Java フォーマッター設定に従います。変更を行う前に IDE を設定してください — フォーマットの違いは実際の変更を見えにくくするノイズの多い差分を生成します。
  • 命名:標準的な Java 命名規約に従います — メソッドと変数には camelCase、クラスには PascalCase、定数には ALL_CAPS。意図を伝える説明的な名前を使用します。
  • コメント:public メソッドとクラスに Javadoc を記述します。インラインコメントは何をしているかではなくなぜを説明するべきです — コード自体が何をしているかを示すのに十分明確であるべきです。
  • Null 処理:特にデータベースクエリ結果とユーザー入力を扱う際は、防御的に null 値をチェックします。文字列チェックには Util.isEmpty() を使用します。
  • ロギング:ロギングには CLogger クラスを使用します。適切なレベルでログを記録します — FINE はデバッグ詳細、INFO は重要な操作、WARNING は回復可能なエラー、SEVERE は障害。

SQL 標準

  • SQL キーワードには大文字を使用します(SELECTFROMWHERE)。
  • パラメータ化されたクエリ(プリペアドステートメント)を使用します — ユーザー入力を SQL 文字列に連結しないでください。
  • 可能な限りデータベースに依存しない SQL を記述します(PostgreSQL と Oracle の両方と互換性のある)。データベース固有の構文が必要な場合は、両方のデータベース向けの実装を提供します。

コードレビュープロセス

すべての貢献はマージ前にコードレビューを経ます。コードレビューは複数の目的を果たします:バグの発見、コード品質の確保、知識共有、コードベース全体の一貫性の維持。

レビュアーが確認すること

  • 正確性:コードは主張通りのことを行っていますか?エッジケースは処理されていますか?
  • テスト:適切なテストがありますか?テストは重要なシナリオをカバーしていますか?
  • スタイル:コードはプロジェクトのコーディング標準に従っていますか?
  • パフォーマンス:潜在的なパフォーマンスの問題(N+1 クエリ、不要なデータベース呼び出し、メモリリーク)はありますか?
  • 互換性:変更は PostgreSQL と Oracle の両方で動作しますか?後方互換性は維持されていますか?
  • 移行:データベース変更に移行スクリプトが提供されていますか?正確でべき等ですか?
  • セキュリティ:潜在的なセキュリティの問題(SQL インジェクション、不適切なアクセス制御、情報漏洩)はありますか?

レビューフィードバックへの対応

レビュアーが変更を要求した場合:

  • すべてのコメントに応答します — 要求された変更を行うか、同意しない理由を(根拠とともに)説明します。
  • 追加のコミットを同じブランチにプッシュします(force-push しないでください。レビュアーが何が変わったかを確認しにくくなります)。
  • 忍耐を持ちましょう — レビュアーは時間を貢献するボランティアです。複雑さとレビュアーの可用性に応じて、レビューには数日から数週間かかる場合があります。

良いコミットメッセージの書き方

良いコミットメッセージはプロジェクト履歴に不可欠です。以下の形式に従います:

IDEMPIERE-XXXX: Short summary of the change (50 chars or less)

Longer description if needed. Explain the motivation for the change,
what problem it solves, and any important design decisions. Wrap
lines at 72 characters.

- Bullet points are acceptable for listing multiple changes
- Reference related tickets if applicable
  • 最初の行は件名です:JIRA チケット番号で始め、簡潔な要約を続けます。
  • 件名と本文は空行で区切ります。
  • 件名には命令形を使用します(「Fix bug」であり、「Fixed bug」や「Fixes bug」ではない)。
  • 本文は変更が行われた理由を説明し、何が変更されたかだけではありません(差分が何を示します)。

コア変更の移行スクリプト

貢献にデータベース変更(新テーブル、新カラム、変更されたカラム、新参照データ)が含まれる場合、移行スクリプトを提供する必要があります。iDempiere はアップグレードプロセス中に実行される SQL 移行スクリプトを使用します。

移行スクリプトの構造

-- 移行スクリプトの場所:
-- migration/iN.N/postgresql/YYYYMMDDHHMMSS_IDEMPIERE-XXXX.sql

-- 例:C_BPartner に新しいカラムを追加
-- IDEMPIERE-6123 Add preferred communication channel to Business Partner

SELECT register_migration_script('YYYYMMDDHHMMSS') FROM dual;

-- カラムの追加
ALTER TABLE C_BPartner ADD COLUMN PreferredChannel VARCHAR(2) DEFAULT 'EM';

-- Application Dictionary に追加
INSERT INTO AD_Column (AD_Column_ID, AD_Client_ID, AD_Org_ID, IsActive,
    Created, CreatedBy, Updated, UpdatedBy,
    Name, Description, AD_Table_ID, ColumnName, FieldLength,
    AD_Reference_ID, DefaultValue, IsKey, IsParent, IsMandatory,
    IsUpdateable, IsIdentifier, AD_Element_ID)
VALUES (get_next_id('AD_Column'), 0, 0, 'Y',
    now(), 100, now(), 100,
    'Preferred Channel', 'Preferred communication channel',
    291, 'PreferredChannel', 2,
    17, 'EM', 'N', 'N', 'N',
    'Y', 'N', get_next_id('AD_Element'));

-- Oracle 版も提供
-- migration/iN.N/oracle/YYYYMMDDHHMMSS_IDEMPIERE-XXXX.sql

移行スクリプトの要件

  • PostgreSQL と Oracle の両方のデータベース用のスクリプトを提供します。
  • スクリプトは可能な限りべき等であるべきです — 同じスクリプトを 2 回実行してもエラーが発生しないようにします(IF NOT EXISTS 句を使用、挿入前にチェック)。
  • 正しい命名規約を使用します:YYYYMMDDHHMMSS_IDEMPIERE-XXXX.sql(タイムスタンプは作成時刻を示す)。
  • Application Dictionary の更新(AD_Table、AD_Column、AD_Field など)を含めます — データベーススキーマの変更だけでなく。
  • register_migration_script() で移行スクリプトを登録し、どのスクリプトが適用済みかをシステムに認識させます。

貢献のテスト要件

iDempiere プロジェクトは org.idempiere.test バンドルでテストスイートを維持しています。貢献には可能な限りテストを含めるべきです。

テストの作成

// 例:支払配賦のバグ修正テスト
public class PaymentAllocationTest extends AbstractTestCase {

    @Test
    public void testAllocationWithZeroDiscount() {
        // テストデータのセットアップ
        MBPartner bp = new MBPartner(Env.getCtx(), 0, getTrxName());
        bp.setName("Test Partner");
        bp.setIsCustomer(true);
        bp.saveEx();

        // 請求書の作成と完了
        MInvoice invoice = createTestInvoice(bp, new BigDecimal("100.00"));
        completeDocument(invoice);

        // ゼロ割引での配賦を作成(バグシナリオ)
        MAllocationHdr alloc = new MAllocationHdr(Env.getCtx(), true,
            Env.getContextAsDate(Env.getCtx(), "#Date"),
            116, "Test allocation", getTrxName());
        alloc.saveEx();

        MAllocationLine line = new MAllocationLine(alloc,
            new BigDecimal("100.00"),
            BigDecimal.ZERO,  // ゼロ割引 - 以前は NPE を引き起こした
            BigDecimal.ZERO,
            BigDecimal.ZERO);
        line.setC_Invoice_ID(invoice.get_ID());
        line.saveEx();

        // NPE をスローしないはず(修正)
        String result = alloc.completeIt();
        assertEquals(DocAction.STATUS_Completed, result);
        assertEquals(BigDecimal.ZERO, invoice.getOpenAmt());
    }
}

コミュニティコミュニケーション

コミュニティのコミュニケーションチャネルへの積極的な参加は、効果的な貢献に不可欠です。

メーリングリスト

Google Groups の iDempiere メーリングリストは主要なコミュニケーションチャネルです:

  • idempiere-developers:コード、アーキテクチャ、開発プラクティスに関する技術的な議論。
  • idempiere-users:機能に関する議論、ユーザーサポート、導入に関する質問。

フォーラムと Wiki

iDempiere の Wiki にはドキュメント、ハウツーガイド、アーキテクチャノートが含まれています。ドキュメントへの貢献はコードへの貢献と同様に価値があります — おそらくそれ以上です。良いドキュメントは単一のバグ修正よりもはるかに多くの人を助けるからです。

iDempiere カンファレンス

年次の iDempiere World Conference は、プレゼンテーション、ワークショップ、ネットワーキングのためにコミュニティを集めます。カンファレンスへの参加(またはプレゼンテーション)は、関与を深め、他のコミュニティメンバーとの関係を構築する優れた方法です。

コミッターになる

コミッターのステータスは、実証された実績に基づいて PMC から付与されます。固定のチェックリストはありませんが、以下の行動が可能性を高めます:

  • 継続的な貢献:長期間(数か月から数年)にわたる定期的で高品質な貢献は、持続的なコミットメントを示します。
  • コード品質:最小限の変更で一貫してレビューを通過する提出は、技術的成熟度を示します。
  • コミュニティ参加:議論への積極的な参加、他のユーザーの支援、Pull Request のレビュー、ドキュメントへの貢献。
  • ドメイン専門知識:iDempiere の特定の領域(例:会計エンジン、製造、レポート)に関する深い知識は、レビューと貢献を特に価値あるものにします。
  • 信頼性:コミットメントの履行、レビューフィードバックへの迅速な対応、信頼できるコミュニティメンバーであること。

知的財産とライセンス

iDempiere は GNU General Public License version 2(GPLv2)の下でライセンスされています。iDempiere にコードを貢献する際、あなたの貢献がこのライセンスの下で配布されることに同意することになります。

主要なライセンスの考慮事項

  • コピーレフト:GPLv2 は派生物も GPLv2 の下で配布することを要求します。iDempiere のコアコードを変更した場合、変更は同じライセンスの下でオープンソースにする必要があります。
  • プラグインの例外:iDempiere の公開 API と拡張ポイント(OSGi サービス、モデルバリデーター、コールアウト)を通じてやり取りするプラグインは、一般的に独立した著作物とみなされ、異なるライセンスの下で配布できます。これは商用プラグイン開発者にとって重要な区別です。
  • 貢献者契約:提出するコードを貢献する権利があることを確認してください。雇用されている場合、雇用主があなたが書いたコードに対する知的財産権を主張する可能性があります。貢献前にこれを明確にしてください。
  • サードパーティのコード:ライセンスが GPLv2 と互換性がない限り、他のプロジェクトのコードを含めないでください。貢献に含まれるサードパーティのコードのソースとライセンスを文書化してください。

まとめ

iDempiere への貢献は、依存するプラットフォームを改善し、専門的な評判を築き、グローバルなオープンソースコミュニティに参加するやりがいのある方法です。主なステップは以下の通りです:

  • 変更の JIRA チケットを作成する。
  • リポジトリをフォークし、フィーチャーブランチを作成し、コーディング標準に従って変更を実装する。
  • 必要に応じてテストと移行スクリプトを作成する。
  • 明確な説明と JIRA 参照を含む Pull Request を提出する。
  • コードレビューのフィードバックに建設的に対応する。
  • コード貢献以外のコミュニティ議論にも参加する。

次のレッスンでは、ケーススタディを通じて実際の iDempiere デプロイメントを探ります — さまざまな業界におけるエンタープライズ導入の成功と課題から学びます。

You Missed