Skip to content

Migrate all main/v5 code to OSS repo#83

Merged
stippi2 merged 45 commits intomainfrom
migrate-v5-code
Oct 4, 2023
Merged

Migrate all main/v5 code to OSS repo#83
stippi2 merged 45 commits intomainfrom
migrate-v5-code

Conversation

@stippi2
Copy link
Member

@stippi2 stippi2 commented Oct 2, 2023

The process was:

  • Remove all module directories from OSS repo in one commit
  • Add all module directories from main/v5 branch (Oct 02 ~0900) to OSS repo in one commit authored by cloudsdk@sap.com
  • Update files in scripts with their version from scripts/python from main/v5
  • Look closely at the diff of all pom.xml files & restore changes from OSS Repo:
    • Remove cx-server related stuff from archetypes resources
    • modules-bom/pom.xml
      • Reformat
      • Restore <build> section with plugins from the previous OSS version of the file
    • bom/pom.xml:
      • Reformat
      • Add <build> section with plugins (see above)
    • Restore root POM Javadoc changes
    • Restore root POM Jacoco changes (:warning: please check)
    • Add property project.build.sourceEncoding in bom/pom.xml and modules-bom/pom.xml, required for Code Formatting check to pass. The OSS version of modules-bom/pom.xml previously configured the encoding property of the formatter plugin in the build section. This should be an equivalent change.
    • Adjust the allowed "high" findings count for PMD, SpotBugs and FindBugs. (:warning: needs proper fix via correct exclusions)

⚠️ Please don't squash merge this one, in order to preserve authorship of cloudsdk@sap.com for all source code.

.warn(
"Did not find any '{}' headers to add to the outgoing request, even though Authentication type '{}' is set.",
HttpHeaders.AUTHORIZATION,
AuthenticationType.TOKEN_FORWARDING);

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files

This [potentially sensitive information](1) is written to a log file.
.debug(
"Loading destination from reuse-destination-service with retrieval strategy {} and token exchange strategy {}.",
retrievalStrategy,
tokenExchangeStrategy);

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files

This [potentially sensitive information](1) is written to a log file.
@stippi2 stippi2 marked this pull request as ready for review October 2, 2023 10:29
@stippi2 stippi2 self-assigned this Oct 2, 2023
@CharlesDuboisSAP
Copy link
Contributor

CharlesDuboisSAP commented Oct 2, 2023

  • The bom/pom.xml shouldn't have the extra plugins and the extra <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>.
  • The modules-bom/pom.xml has an extra <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> that can be removed.
  • (Minor) Every pom but the two boms are formatted with tabs, those two should be consistent
  • The use of http or https ://www.apache.org/licenses/LICENSE-2.0.txt is inconsistent throughout the repo
  • What is the new file .adr-dir.
  • Remove the commented jacoco config in the main parent pom
  • The PMD plugin does not find all 701 warnings, only 14
  • Findbugs found 800 bugs -> did it never work before? If yes then adjust thresholds
  • Discrepancy in the Checkstyle results, also adjusts thresholds after
  • Where can we find coverageThresholds? Also adjust them if the report can be found
  • line missing in intellij_java_style
  • Why was the config removed from the scp-cf-spring archetype?
  • Why was the Setup java step added to the .github/workflow.build.yml?
  • Remove the extra .gitignore files (our fault)
  • scripts/common/release_audience.py has an extra "Internal" audience, is this intentional?
  • Unintentional change line 40 in scripts/create_module_invetory_file.py

@stippi2
Copy link
Member Author

stippi2 commented Oct 2, 2023

  • The bom/pom.xml shouldn't have the extra plugins and the extra <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>.
  • The modules-bom/pom.xml has an extra <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> that can be removed.

The "Code Formatting" job in the pipeline fails if the encoding property of the formatter-maven-plugin is not defined. Since those two POMs don't inherit from the sdk-parent POM, the property is not configured (it defaults to project.build.sourceEncoding). Maybe the POMs should be excluded from the formatting checks, but that doesn't seem plausible to me. Should the encoding be specified some other way?

@CharlesDuboisSAP
Copy link
Contributor

  • scripts/common/release_audience.py has an extra "Internal" audience, is this intentional?

Yes, since at least one of the modules has the audience property with this value, and generating the modules_inventory.json file then fails. We do generate this faile as part of the pipeline and validate that it doesn't result in changes.

I will set the modules to Public and remove the audience type Internal.

Comment on lines 27 to 39
codeCheck:
checkstyle:
high: '3'
high: '14'
normal: '-1'
low: '-1'
findbugs:
high: '0'
high: '10'
normal: '-1'
low: '-1'
pmd:
high: '0'
high: '10'
normal: '-1'
low: '-1'
Copy link
Contributor

@CharlesDuboisSAP CharlesDuboisSAP Oct 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Where can we find coverageThresholds? Also adjust them if the report can be found

Can be found here and there is a TODO for adjusting it after migrating the code. Should I adjust within this PR?

Yes we should adjust the thresholds in this PR.
@newtork @KavithaSiva do you think we should investigate the difference in amount of findings?

  • The PMD plugin does not find all 701 warnings, only 14
  • Findbugs found 800 bugs -> did it never work before? If yes then adjust thresholds
  • Discrepancy in the Checkstyle results

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!
I don't know why I was added as a reviewer on this PR. I'm a technical writer working on Commerce Cloud. Could you please remove me? Thank you!

@KavithaSiva KavithaSiva requested review from newtork and removed request for adumontb October 2, 2023 13:48
@stippi2
Copy link
Member Author

stippi2 commented Oct 2, 2023

Could the PMD and CheckStyle differences be explained by the different rulesets (see root-POM changes)?

@CharlesDuboisSAP
Copy link
Contributor

LGTM, but let's wait for someone else's review.

@stippi2
Copy link
Member Author

stippi2 commented Oct 4, 2023

Let's get the excludes working for Jacoco coverage first...

Copy link
Contributor

@newtork newtork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yolo

@stippi2 stippi2 merged commit 34c9fda into main Oct 4, 2023
@stippi2 stippi2 deleted the migrate-v5-code branch October 4, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants