Commit a45d5b0
fix: correct git timestamp retrieval and integration test issues
Fix critical bug where git commands were running without a working
directory set, causing 'exit status 128' failures. Also fix 7 issues
in TestDockerPackage_OCILayout_Determinism_Integration.
Git Timestamp Fix:
- Move getGitCommitTimestamp from sbom.go to gitinfo.go
- Rename to GetCommitTimestamp (exported, follows codebase patterns)
- Accept GitInfo directly (contains commit hash and working directory)
- Ensure git commands run in correct repository directory
- Improve error handling and messages
Integration Test Fixes:
1. Use FindWorkspace instead of undefined Load function
2. Correct build method signature (buildctx parameter)
3. Fix package name format (use FullName())
4. Initialize buildContext properly (avoid nil pointer)
5. Initialize ConsoleReporter (avoid nil pointer)
6. Set git user config (required for commits)
7. Use deterministic git timestamps (GIT_AUTHOR_DATE/GIT_COMMITTER_DATE)
Impact:
- Fixes CI failures when building Docker packages
- Enables integration test to run successfully
- Verifies OCI layout determinism (same checksum across builds)
- Improves code organization and maintainability
Verification:
- Unit tests pass
- Integration test passes with deterministic checksums
- No backward compatibility issues
Co-authored-by: Ona <no-reply@ona.com>1 parent 6bc7552 commit a45d5b0
File tree
5 files changed
+129
-62
lines changed- pkg/leeway
5 files changed
+129
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2437 | 2437 | | |
2438 | 2438 | | |
2439 | 2439 | | |
2440 | | - | |
| 2440 | + | |
2441 | 2441 | | |
2442 | | - | |
| 2442 | + | |
2443 | 2443 | | |
2444 | | - | |
| 2444 | + | |
2445 | 2445 | | |
2446 | 2446 | | |
2447 | 2447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
593 | 605 | | |
594 | 606 | | |
595 | 607 | | |
596 | 608 | | |
597 | 609 | | |
598 | 610 | | |
| 611 | + | |
| 612 | + | |
599 | 613 | | |
600 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
601 | 619 | | |
602 | 620 | | |
603 | 621 | | |
604 | 622 | | |
605 | 623 | | |
606 | 624 | | |
607 | | - | |
| 625 | + | |
| 626 | + | |
608 | 627 | | |
609 | 628 | | |
610 | 629 | | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
616 | 638 | | |
617 | 639 | | |
618 | | - | |
| 640 | + | |
619 | 641 | | |
620 | 642 | | |
621 | 643 | | |
622 | 644 | | |
623 | | - | |
| 645 | + | |
624 | 646 | | |
625 | | - | |
| 647 | + | |
626 | 648 | | |
627 | 649 | | |
628 | | - | |
| 650 | + | |
629 | 651 | | |
630 | 652 | | |
631 | 653 | | |
| |||
641 | 663 | | |
642 | 664 | | |
643 | 665 | | |
644 | | - | |
| 666 | + | |
| 667 | + | |
645 | 668 | | |
646 | 669 | | |
647 | 670 | | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
653 | 679 | | |
654 | 680 | | |
655 | | - | |
| 681 | + | |
656 | 682 | | |
657 | 683 | | |
658 | 684 | | |
659 | 685 | | |
660 | | - | |
| 686 | + | |
661 | 687 | | |
662 | | - | |
| 688 | + | |
663 | 689 | | |
664 | 690 | | |
665 | | - | |
| 691 | + | |
666 | 692 | | |
667 | 693 | | |
668 | 694 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
174 | 177 | | |
175 | 178 | | |
176 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | 104 | | |
134 | 105 | | |
135 | 106 | | |
| |||
324 | 295 | | |
325 | 296 | | |
326 | 297 | | |
327 | | - | |
| 298 | + | |
328 | 299 | | |
329 | | - | |
| 300 | + | |
330 | 301 | | |
331 | | - | |
| 302 | + | |
332 | 303 | | |
333 | 304 | | |
334 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
| |||
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
131 | | - | |
| 136 | + | |
132 | 137 | | |
133 | 138 | | |
134 | 139 | | |
135 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
136 | 147 | | |
137 | 148 | | |
138 | 149 | | |
| |||
148 | 159 | | |
149 | 160 | | |
150 | 161 | | |
151 | | - | |
| 162 | + | |
152 | 163 | | |
153 | 164 | | |
154 | 165 | | |
| |||
157 | 168 | | |
158 | 169 | | |
159 | 170 | | |
160 | | - | |
| 171 | + | |
161 | 172 | | |
162 | 173 | | |
163 | 174 | | |
164 | 175 | | |
165 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
166 | 183 | | |
167 | 184 | | |
168 | 185 | | |
| |||
0 commit comments