You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/internals/extensions/source_code_linker.md
+35-19Lines changed: 35 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ The feature is split into **two layers**:
12
12
13
13
1.**Bazel pre-processing (before Sphinx runs)**
14
14
Generates and aggregates JSON caches containing the raw `source_code_link` findings (and, if available, repository metadata like `repo_name/hash/url`).
15
+
Note that "hash" might also be a "version" tag.
15
16
16
17
2.**Sphinx extension (during the Sphinx build)**
17
18
Reads the aggregated JSON, validates and adapts it, and finally injects the links into Sphinx needs in the final layout (**RepoSourceLink**).
@@ -36,6 +37,7 @@ one JSON cache per repository.
36
37
It also adds metadata to each needlink that is needed in further steps.
37
38
38
39
Example of requirement tags:
40
+
39
41
```python
40
42
# Choose one or the other, both mentioned here to avoid detection
41
43
# req-Id/req-traceability: <NEED_ID>
@@ -83,20 +85,23 @@ This step also fills in url & hash if there is a known_good_json provided (e.g.
83
85
84
86
(repo-metadata-rules)=
85
87
#### Repo metadata rules
88
+
86
89
Here are some basic rules regarding the MetaData information
87
90
88
91
In a combo build, a known_good_json **must** be provided.
89
92
If known_good_json is found then the hash & url will be filled for each need by the script.
90
93
91
94
Combo build:
92
-
-`repo_name`: repository name (parsed from filepath in step 1)
93
-
-`hash`: revision/commit hash (as provided by the known_good_json)
94
-
-`url`: repository remote URL (as provided by the known_good_json)
95
+
96
+
-`repo_name`: repository name (parsed from filepath in step 1)
97
+
-`hash`: revision/commit hash (as provided by the known_good_json)
98
+
-`url`: repository remote URL (as provided by the known_good_json)
95
99
96
100
Local build:
97
-
-`repo_name`: 'local_repo'
98
-
-`hash`: will be empty at this point, and later filled via parsing the git commands
99
-
-`url`: will be empty at this point, and later filled via parsing the git commands
101
+
102
+
-`repo_name`: 'local_repo'
103
+
-`hash`: will be empty at this point, and later filled via parsing the git commands
104
+
-`url`: will be empty at this point, and later filled via parsing the git commands
100
105
101
106
---
102
107
@@ -140,6 +145,7 @@ def test_feature():
140
145
...
141
146
142
147
```
148
+
143
149
> Note: If you use the decorator, it will check that you have specified a docstring inside the function.
144
150
145
151
#### Data Flow
@@ -153,7 +159,7 @@ def test_feature():
153
159
- Result (e.g. passed, failed, skipped)
154
160
- Result text (if failed/skipped will check if message was attached to it)
0 commit comments