Skip to content

Commit c3ae1ea

Browse files
authored
Merge pull request #1376 from okorach:export-branch-analysis-history
Export branch analysis history
2 parents 41b9f16 + a427875 commit c3ae1ea

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

migration/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ When sonar-migration complete successfully they return exit code 0. En case of f
112112

113113
- Robustness: Handle `connectionError` errors in project extract threads
114114
- Added option `--skipIssues` to skip expensive issue count extraction task from the extract which may be necessary on large platforms extracts
115+
- Added export of analysis history
115116

116117
## Version 0.2
117118

@@ -140,18 +141,18 @@ When sonar-migration complete successfully they return exit code 0. En case of f
140141
- Last background task scanner context and warnings
141142
- Background Task history
142143
- Issues:
143-
- # of issue False positive
144-
- # of issues Won’t fix
145-
- # of issues Accepted
146-
- # of issues generated by 3rd party rules (with breakdown per rule)
144+
- Nbr of issue False positive
145+
- Nbr of issues Won’t fix
146+
- Nbr of issues Accepted
147+
- Nbr of issues generated by 3rd party rules (with breakdown per rule)
147148
- For each branch:
148149
- Last analysis date
149150
- Ncloc w/ breakdown by language
150151
- Issues
151-
- # of issue False positive
152-
- # of issues Won’t fix
153-
- # of issues Accepted
154-
- # of issues generated by 3rd party rules (with breakdown per rule)
152+
- Nbr of issue False positive
153+
- Nbr of issues Won’t fix
154+
- Nbr of issues Accepted
155+
- Nbr of issues generated by 3rd party rules (with breakdown per rule)
155156

156157
# License
157158

migration/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ if [ "$release" = "1" ]; then
6060
fi
6161

6262
if [ "$release_docker" = "1" ]; then
63-
docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-migration:0.2 -t olivierkorach/sonar-migration:latest -f migration/release.Dockerfile .
63+
docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-migration:0.3 -t olivierkorach/sonar-migration:latest -f migration/release.Dockerfile .
6464
fi

migration/release.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ COPY ./LICENSE .
3131
COPY ./sonar/audit sonar/audit
3232

3333
RUN pip install --upgrade pip \
34-
&& pip install sonar-migration==0.2 --force-reinstall
34+
&& pip install sonar-migration==0.3 --force-reinstall
3535

3636
USER ${USERNAME}
3737
WORKDIR /home/${USERNAME}

migration/sonar_migration

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ sonar-migration version {version.PACKAGE_VERSION}
2828
2929
run: sonar-migration -u <SonarQubeURL> -t <SonarAdminUserToken>
3030
31-
See tools built-in -h help and https://github.com/okorach/sonar-tools/doc/README.sonar-migration.md for more documentation
31+
See tools built-in -h help and https://github.com/okorach/sonar-tools/migration/README.md for more documentation
3232
''')

migration/what-is-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- Robustness: Handle `connectionError` errors in project extract threads
44
- Added option `--skipIssues` to skip expensive issue count extraction task from the extract which may be necessary on large platforms extracts
5-
5+
- Added export of analysis history
66

77
# Version 0.2
88

sonar/components.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def migration_export(self, export_settings: types.ConfigSettings) -> dict[str, a
178178
loc_distrib = {m.split("=")[0]: int(m.split("=")[1]) for m in lang_distrib.split(";")}
179179
loc_distrib["total"] = self.loc()
180180
json_data["ncloc"] = loc_distrib
181+
json_data["analysisHistory"] = {r[0]: int(r[2]) for r in self.get_measures_history(["ncloc"])}
181182
if export_settings["SKIP_ISSUES"]:
182183
log.debug("Issues count extract skipped for %s`", str(self))
183184
return json_data
@@ -198,6 +199,7 @@ def migration_export(self, export_settings: types.ConfigSettings) -> dict[str, a
198199
"fixed": hotspot_count(self.endpoint, resolution=["FIXED"], **params),
199200
}
200201
log.debug("%s has these notable issues %s", str(self), str(json_data["issues"]))
202+
201203
return json_data
202204

203205
def get_measures(self, metrics_list: types.KeyList) -> dict[str, any]:

0 commit comments

Comments
 (0)