Skip to content

Commit 3528842

Browse files
docs: Add Table of Contents and consolidated guide to signing.md (#455) (#692)
Signed-off-by: Rishabh Ranjan Singh <[email protected]> Signed-off-by: exploreriii <[email protected]> Co-authored-by: exploreriii <[email protected]>
1 parent 3411241 commit 3528842

File tree

2 files changed

+38
-19
lines changed

2 files changed

+38
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
2727
- fix: Replaced `collections.namedtuple` with `typing.NamedTuple` in `client.py` for improved type checking.
2828
- chore: Refactored examples/custom_fee.py into three separate example files.
2929
- Expanded `docs/sdk_developers/checklist.md` with a self-review guide for all pull request submission requirements (#645).
30+
- Expanded docs/sdk_developers/signing.md to clarify GPG and DCO requirements and add a Table of Contents (#455).
3031
- chore: Standardized client initialization across all examples/ files to promote consistency (#658).
3132

3233

docs/sdk_developers/signing.md

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,49 @@
1-
# Commit Signing Guidelines (DCO + GPG)
1+
# Commit Signing Guidelines (DCO + GPG)
22

33
To contribute to this repository, **both DCO sign-off and GPG signature verification** are required for your commits to be merged successfully.
44

55
This guide walks you through how to correctly configure and sign your commits, and how to ensure **all commits are properly signed**.
66

77
---
88

9-
## 🛡️ Why Commit Signing?
9+
## Table of Contents
10+
- [Achieving Verified Commits (The Requirements)](#achieving-verified-commits-the-requirements)
11+
- [Step-by-Step Setup](#step-by-step-setup)
12+
- [1. Generate a GPG Key](#1-generate-a-gpg-key)
13+
- [2. Add Your GPG Key to GitHub](#2-add-your-gpg-key-to-github)
14+
- [3. Configure Git to Use Your GPG Key](#3-configure-git-to-use-your-gpg-key)
15+
- [Make Signed Commits](#make-signed-commits)
16+
- [Fixing Unsigned Commits](#fixing-unsigned-commits)
17+
- [Rebasing and Signing](#rebasing-and-signing)
18+
- [Verify Signed Status of Commits](#verify-signed-status-of-commits)
19+
- [Final Checklist](#final-checklist)
1020

11-
* **DCO (`Signed-off-by`)** ensures you agree to the developer certificate of origin.
12-
* **GPG Signature** proves the commit was authored by a trusted and verified identity.
21+
---
22+
23+
## Achieving Verified Commits (The Requirements)
24+
25+
Achieving a **"Verified"** status on GitHub is a **MANDATORY** requirement for all Pull Requests to be merged into the Python SDK. PRs without this badge will be blocked by CI checks.
26+
27+
| Signature | Flag | Purpose | GitHub Check | Required Documentation |
28+
| :--- | :--- | :--- | :--- | :--- |
29+
| **DCO Sign-off** | `-s` | Confirms legal right to contribute code (Required by the CI bot). | DCO Check | [CONTRIBUTING.md](/CONTRIBUTING.md) |
30+
| **GPG Signature** | `-S` | Proves you are the author of the commit (Requires GPG setup). | Verified Badge | [GitHub's GPG Docs](https://docs.github.com/en/authentication/managing-commit-signature-verification) |
31+
32+
**CRITICAL WARNING:** To pass all checks and achieve the "Verified" status, **all commits** must be signed using **both** the `-S` and `-s` flags together.
1333

1434
---
1535

16-
## ✍️ Step-by-Step Setup
36+
## Step-by-Step Setup
1737

1838
### 1. Generate a GPG Key
1939

20-
If you dont already have a GPG key:
40+
If you don't already have a GPG key:
2141

2242
```bash
2343
gpg --full-generate-key
2444
```
2545

2646
Choose:
27-
2847
* Kind: RSA and RSA
2948
* Key size: 4096
3049
* Expiration: 0 (or choose as per your need)
@@ -50,7 +69,6 @@ gpg --armor --export YOUR_KEY_ID
5069
```
5170

5271
Paste the output into GitHub:
53-
5472
* [Add GPG key on Github](https://github.com/settings/gpg/new)
5573

5674
---
@@ -64,7 +82,7 @@ git config --global commit.gpgsign true
6482

6583
---
6684

67-
## Make Signed Commits
85+
## Make Signed Commits
6886

6987
**All commits must be signed using both DCO and GPG.**
7088

@@ -79,7 +97,7 @@ git commit -S -s -m "chore: your commit message"
7997
8098
---
8199

82-
## 🛠️ Fixing Unsigned Commits
100+
## Fixing Unsigned Commits
83101

84102
If you accidentally forgot to sign commits, there are **two ways to fix them**:
85103

@@ -91,8 +109,8 @@ Soft revert the impacted commits while keeping changes locally:
91109
git reset --soft HEAD~n
92110
```
93111

94-
* `HEADn` = number of commits to go back
95-
* Example: To fix the last 3 commits: `git reset --soft HEAD`
112+
* `HEAD~n` = number of commits to go back
113+
* Example: To fix the last 3 commits: `git reset --soft HEAD~3`
96114

97115
Then, recommit each commit with proper signing:
98116

@@ -110,25 +128,25 @@ Alternatively, you can **amend commits retroactively**:
110128

111129
```bash
112130
git commit --amend -S -s
113-
git rebase -i HEAD~n # For multiple commits
131+
git rebase -i HEAD~n # For multiple commits
114132
git push --force-with-lease
115133
```
134+
116135
## Rebasing and Signing
117136

118137
Rebase operations will be required when your branch is behind the upstream main. See [rebasing.md](./rebasing.md) for instructions on how to keep your main branch up to date and how to rebase.
119138

120-
121139
When rebasing, you must use this command to ensure your commits remain verified:
122140

123141
```bash
124142
git rebase main -S
125143
```
126144

127-
> **Note:** `--force-with-lease` safely updates the remote branch without overwriting others changes.
145+
> **Note:** `git push --force-with-lease` safely updates the remote branch without overwriting others' changes.
128146
129147
---
130148

131-
## Verify Signed Status of Commits
149+
## Verify Signed Status of Commits
132150

133151
To check that your commits are signed correctly:
134152

@@ -147,7 +165,7 @@ git log -n 5 --pretty=format:'%h %an %G? %s'
147165

148166
---
149167

150-
## Final Checklist
168+
## Final Checklist
151169

152170
* [ ] All commits signed with `-S`
153171
* [ ] DCO added with `-s`
@@ -158,5 +176,5 @@ git log -n 5 --pretty=format:'%h %an %G? %s'
158176

159177
### Still Need Help?
160178

161-
* Refer to [GitHubs GPG Docs](https://docs.github.com/en/authentication/managing-commit-signature-verification)
162-
* Ask maintainers on the **Hiero Discord** if stuck
179+
* Refer to [GitHub's GPG Docs](https://docs.github.com/en/authentication/managing-commit-signature-verification)
180+
* Ask maintainers on the **Hiero Discord**

0 commit comments

Comments
 (0)