Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2023.11.13 #22

Merged
merged 43 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
dd8c412
Initial commit
Jul 19, 2023
6e0bdb6
Merge branch 'main'
Jul 19, 2023
078076c
JSMT-24 - create initial pipeline for building add-on
Jul 24, 2023
c138ee4
Merged in JSMT-24_initial_pipeline_addon (pull request #2)
Jul 24, 2023
ab3c732
Merged in JSMT-24_build_pipelines (pull request #3)
Jul 25, 2023
306a477
JSMT-24 - create tag step for add-on pipeline
Jul 26, 2023
c0d061a
JSMT-24 - add ssh for git operations
Jul 26, 2023
5ff0be7
JSMT-24 - fix tag
Jul 26, 2023
8e4baee
JSMT-24 - set tag step as manual
Jul 26, 2023
9681a0d
JSMT-24 - Remove unused servlets from the plugin file
Aug 2, 2023
948adf6
JSMT-24 - fix package version
Aug 2, 2023
6109b47
JSMT-24 - fix package version #2
Aug 2, 2023
981eca6
Merged in task/JSMT-24_tag_step_add_on (pull request #4)
Aug 3, 2023
6358405
JSMT-24 - run tag pipeline manually only
Aug 7, 2023
6bfd1da
Merged in task/JSMT-24_fix_manual_pipelines (pull request #5)
Aug 7, 2023
39cb94b
Merged in task/JSMT-24_unify_tag_and_package (pull request #6)
Aug 10, 2023
344cd7d
JSMT-9 - configure code analyser for maven project
Aug 10, 2023
0f98424
Merged in task/JSMT-9_configure_code_analyzer (pull request #7)
Aug 10, 2023
ef712a4
JSMT-46 - pipeline to run Snyk scans
Aug 14, 2023
379189e
Merged in task/JMST-46_snyk_scan (pull request #8)
Aug 16, 2023
130aee1
JSMT-109 - add snyk configuration
Aug 30, 2023
7451d33
JSMT-109 - change team name
Aug 31, 2023
b194999
JSMT-60 updated add-on installation steps
zakharlistiev Oct 3, 2023
959baa9
JSMT-60 resolved PR comment
zakharlistiev Oct 3, 2023
99d22dc
JSMT-79 bump org.json version
zakharlistiev Oct 3, 2023
744cd14
Merged in JSMT-60-upate-add-on-installation-steps (pull request #10)
zakharlistiev Oct 3, 2023
07840df
JSMT-109 - change team and product
Oct 3, 2023
5657e76
Merged in task/JSMT-109_snyk_config (pull request #9)
Oct 3, 2023
ae4c106
JSMT-80 bump jose4j version
zakharlistiev Oct 4, 2023
6bf3e7b
Merged in JSMT-80-update-org.bitbucket.b_cjose4j (pull request #12)
zakharlistiev Oct 4, 2023
1550cd4
Merged in VULN-1096669-vulnerability-in-org.json (pull request #11)
zakharlistiev Oct 4, 2023
d59896c
Merged in task/JSMT-77_fix_checkstyle_issues (pull request #13)
Oct 12, 2023
a57f273
JSMT-118 - upgrade org.json:jsobnn to 20231013
Oct 16, 2023
3616957
Merged in task/JSMT-118_upgrade_json_lib (pull request #14)
Oct 16, 2023
fc91879
JSMT-81 JSMT-82 JSMT 83 JSMT-84 - update dependencies to improve secu…
Oct 24, 2023
9d28c4d
JSMT-123 - fix snyk configuration
Oct 24, 2023
bd21e5f
Merged in JSMT-81_update_dependencies (pull request #15)
Oct 25, 2023
8c70917
Merged in JSMT-123_update_snyk_configs (pull request #16)
Oct 25, 2023
aa91264
JSMT-1111 - improve image processing
Oct 26, 2023
167c7ad
JSMT-111 - extend error message
Oct 26, 2023
163d1c6
Merged in JSMT-111_fix_image_processing (pull request #17)
Oct 27, 2023
56a76d5
JSMT-150 - update pipelines for release branch
Nov 6, 2023
3398083
Merged in task/JSMT-150_update_pipelines (pull request #18)
Nov 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ integration.iml
.settings/org.eclipse.core.resources.prefs
.settings/org.eclipse.jdt.apt.core.prefs
.settings/org.eclipse.jdt.core.prefs

# Snyk Configs
security-assistant.yml
147 changes: 147 additions & 0 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Pipeline for building and publishing msteams-jira-addon project
image: atlassian/default-image:4

options:
docker: true
size: 2x
definitions:
services:
docker:
memory: 5000
steps:
- step: &dockerImage
name: Prepare custom Docker image
services:
- docker
caches:
- docker
script:
- pipe: atlassian/artifactory-sidekick:v1
- source .artifactory/activate.sh
- export IMG_TAG=docker.atl-paas.net/atlassian/netrunners/ubuntu-pwsh-mvn
- docker build --tag="$IMG_TAG" --file docker/Dockerfile .
- docker push "$IMG_TAG"
- step: &buildAndPack
name: Build package
image:
name: docker-proxy.services.atlassian.com/atlassian/netrunners/ubuntu-pwsh-mvn
username: netrunners
password: $PIPELINES_JWT_TOKEN
script:
- PACKAGE_VERSION=$(date +%Y.%m.%d)
- PACKAGE_ZIP_NAME=$PACKAGE_ZIP_NAME_PREFIX$PACKAGE_VERSION
# Remove internal servlets
- rm ./src/main/java/com/microsoft/teams/servlets/TeamsAtlasUserServlet.java;
- rm ./src/test/java/com/microsoft/teams/servlets/TeamsAtlasUserServletTest.java
- xmlstarlet edit -L -d "/atlassian-plugin/servlet[@key='test']" src/main/resources/atlassian-plugin.xml
# Replace ArtifactId Value
- xmlstarlet edit -L -N s=http://maven.apache.org/POM/4.0.0 -u "/s:project/s:artifactId" -v $PACKAGE_NAME pom.xml
- echo "`xmlstarlet sel -N s=http://maven.apache.org/POM/4.0.0 -t -v "/s:project/s:artifactId" pom.xml`"
# Replace Version Value
- xmlstarlet edit -L -N s=http://maven.apache.org/POM/4.0.0 -u "/s:project/s:version" -v $PACKAGE_VERSION pom.xml
- echo "`xmlstarlet sel -N s=http://maven.apache.org/POM/4.0.0 -t -v "/s:project/s:version" pom.xml`"
# Replace FinalName Value
- xmlstarlet edit -L -N s=http://maven.apache.org/POM/4.0.0 -u "/s:project/s:build/s:finalName" -v $PACKAGE_NAME-$PACKAGE_VERSION pom.xml
- echo "`xmlstarlet sel -N s=http://maven.apache.org/POM/4.0.0 -t -v "/s:project/s:build/s:finalName" pom.xml`"
# Replace ProjectName Value
- xmlstarlet edit -L -N s=http://maven.apache.org/POM/4.0.0 -u "/s:project/s:name" -v "$PROJECT_NAME" pom.xml
- echo "`xmlstarlet sel -N s=http://maven.apache.org/POM/4.0.0 -t -v "/s:project/s:name" pom.xml`"
# Run a powershell script
- pwsh ./setEnvironmentProperties.ps1 "src/main/resources/integration.properties" $APP_ID $PACKAGE_NAME "$APP_URL/JiraGateway?atlasId=%s&atlasUrl=%s&pluginVersion=%s" $PACKAGE_VERSION $APP_URL
- cat src/main/resources/integration.properties
# Build package
- atlas-mvn -B package --file pom.xml
# Zip package
- pushd target; zip ./../$PACKAGE_ZIP_NAME.zip $PACKAGE_NAME-$PACKAGE_VERSION.jar; popd
artifacts:
- RefAppAddon.*.zip
- step: &buildAndTest
name: Build & test
image:
name: docker-proxy.services.atlassian.com/atlassian/netrunners/ubuntu-pwsh-mvn
username: netrunners
password: $PIPELINES_JWT_TOKEN
script:
# Build package and run tests
- atlas-mvn test
- step: &createTag
name: Create tag
script:
- TAG_NAME=$(date +%Y.%m.%d)
- echo "Creating new tag ${TAG_NAME}"
- git tag -am "Tag ${TAG_NAME}" $TAG_NAME
- git push origin $TAG_NAME
- step: &snyk-scan
name: Run Snyk scan
image:
name: docker-proxy.services.atlassian.com/atlassian/netrunners/ubuntu-pwsh-mvn
username: netrunners
password: $PIPELINES_JWT_TOKEN
script:
- pipe: atlassian/artifactory-sidekick:v1
- source .artifactory/activate.sh
# Build package and skip tests
- atlas-mvn package -DskipTests
# Add mvn to PATH
- export MAVEN_HOME=$(echo "`atlas-version`" | grep -oP '(?<=ATLAS Maven Home:\ )(.)+$')/bin
- export PATH=${PATH}:${MAVEN_HOME}
# Install Snyk
- npm install -g snyk
# Run Snyk monitor and skip all provided dependencies
- snyk monitor . -- -Dscope=runtime
- step: &pushToGithub
name: Push changes to Github repo
script:
- git remote add github [email protected]:atlassian-labs/msteams-jira-server-addon.git
- git push -u github ${BITBUCKET_BRANCH}
- git push github --follow-tags
pipelines:
default:
- step:
<<: *dockerImage
condition:
changesets:
includePaths:
- 'docker/**'
- step: *buildAndTest
custom:
buildDockerImage:
- step:
*dockerImage
createNewTag:
- step:
*createTag
runSnyk:
- step: *snyk-scan
branches:
master:
- step:
<<: *buildAndPack
name: Build integration package
deployment: Integration
- step:
<<: *buildAndPack
name: Build staging package
deployment: Staging
- step:
<<: *buildAndPack
name: Build production package
deployment: Production
release/*:
- step:
<<: *buildAndPack
name: Build integration package
deployment: Integration
- step:
<<: *buildAndPack
name: Build staging package
deployment: Staging
- step:
<<: *buildAndPack
name: Build production package
deployment: Production
- step:
<<: *createTag
trigger: manual
- step:
<<: *pushToGithub
227 changes: 227 additions & 0 deletions checkstyle/sun_checks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--

Checkstyle configuration that checks the sun coding conventions from:

- the Java Language Specification at
https://docs.oracle.com/javase/specs/jls/se11/html/index.html

- the Sun Code Conventions at https://www.oracle.com/technetwork/java/codeconvtoc-136057.html

- the Javadoc guidelines at
https://www.oracle.com/technetwork/java/javase/documentation/index-137868.html

- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/

- some best practices

Checkstyle is very configurable. Be sure to read the documentation at
https://checkstyle.org (or in your downloaded distribution).

Most Checks are configurable, be sure to consult the documentation.

To completely disable a check, just comment it out or delete it from the file.
To suppress certain violations please review suppression filters.

Finally, it is worth reading the documentation.

-->

<module name="Checker">
<property name="charset" value="UTF-8" />
<module name="SuppressWarningsFilter" />

<!--
If you set the basedir property below, then all reported file
names will be relative to the specified directory. See
https://checkstyle.org/5.x/config.html#Checker

<property name="basedir" value="${basedir}"/>
-->
<property name="severity" value="error"/>

<property name="fileExtensions" value="java, properties, xml"/>

<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>

<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
<module name="SuppressionFilter">
<property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
default="checkstyle-suppressions.xml" />
<property name="optional" value="true"/>
</module>

<!-- Checks that a package-info.java file exists for each package. -->
<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
<!--<module name="JavadocPackage"/>-->

<!-- Checks whether files end with a new line. -->
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
<!--<module name="NewlineAtEndOfFile"/>-->

<!-- Checks that property files contain the same keys. -->
<!-- See https://checkstyle.org/config_misc.html#Translation -->
<module name="Translation"/>

<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/config_sizes.html -->
<module name="FileLength">
<property name="max" value="5000"/>
</module>
<!--<module name="LineLength">
<property name="max" value="120"/>
<property name="fileExtensions" value="java"/>
</module>-->

<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module name="FileTabCharacter"/>

<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.org/config_misc.html -->
<!--<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
</module>-->

<!-- Checks for Headers -->
<!-- See https://checkstyle.org/config_header.html -->
<!-- <module name="Header"> -->
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
<!-- <property name="fileExtensions" value="java"/> -->
<!-- </module> -->

<module name="TreeWalker">
<module name="SuppressionCommentFilter"/>
<module name="SuppressWarningsHolder" />

<!-- Checks for Javadoc comments. -->
<!-- See https://checkstyle.org/config_javadoc.html -->
<module name="InvalidJavadocPosition"/>
<!--<module name="JavadocMethod"/>-->
<!--<module name="JavadocType"/>-->
<!--<module name="JavadocVariable"/>-->
<!--<module name="JavadocStyle"/>-->
<!--<module name="MissingJavadocMethod"/>-->

<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.org/config_naming.html -->
<!--<module name="ConstantName"/>-->
<!--<module name="LocalFinalVariableName"/>-->
<!--<module name="LocalVariableName"/>-->
<!--<module name="MemberName"/>-->
<!--<module name="MethodName"/>-->
<module name="PackageName"/>
<!--<module name="ParameterName"/>-->
<!--<module name="StaticVariableName"/>-->
<module name="TypeName"/>

<!-- Checks for imports -->
<!-- See https://checkstyle.org/config_import.html -->
<!--<module name="AvoidStarImport"/>-->
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="IllegalImport">
<property name="illegalPkgs" value="clover,org.jetbrains.annotations"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports">
<property name="processJavadoc" value="true"/>
</module>

<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/config_sizes.html -->
<!--<module name="MethodLength"/>-->
<!--<module name="ParameterNumber"/>-->

<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter">
<!-- removes ARRAY_DECLARATOR from default -->
<property name="tokens" value="ARRAY_INIT, BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
</module>
<module name="NoWhitespaceBefore"/>
<!--<module name="OperatorWrap"/>-->
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround">
<!-- removed these from default: GENERIC_START GENERIC_END, WILDCARD_TYPE -->
<!-- TMP TODO remove ASSIGN because of use in annotation assignment -->
<!-- TMP TODO remove RCURLY becauuse of annotations like
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-->
<!-- Tom Davies: removed LCURLY to allow empty interfaces, e.g.
interface Binder extends UiBinder<Widget, ChangesetDiscussionPanel> {}
-->
<property name="tokens" value="BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND"/>
<property name="allowEmptyLambdas" value="true"/>
</module>

<!-- Modifier Checks -->
<!-- See https://checkstyle.org/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier">
<property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CLASS_DEF, ENUM_DEF"/>
</module>

<!-- Checks for blocks. You know, those {}'s -->
<!-- See https://checkstyle.org/config_blocks.html -->
<!--<module name="AvoidNestedBlocks"/>-->
<module name="EmptyBlock">
<property name="option" value="text"/>
</module>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>

<!-- Checks for common coding problems -->
<!-- See https://checkstyle.org/config_coding.html -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<!--<module name="HiddenField"/>-->
<module name="IllegalInstantiation"/>
<!--<module name="InnerAssignment"/>-->
<!--<module name="MagicNumber"/>-->
<!--<module name="MissingSwitchDefault"/>-->
<module name="MultipleVariableDeclarations"/>
<module name="SimplifyBooleanExpression"/>
<!--<module name="SimplifyBooleanReturn"/>-->

<!-- Checks for class design -->
<!-- See https://checkstyle.org/config_design.html -->
<!--<module name="DesignForExtension"/>-->
<!--<module name="FinalClass"/>-->
<!--<module name="HideUtilityClassConstructor"/>-->
<!--<module name="InterfaceIsType"/>-->
<!--<module name="VisibilityModifier"/>-->

<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.org/config_misc.html -->
<module name="ArrayTypeStyle"/>
<!--<module name="FinalParameters"/>-->
<!--<module name="TodoComment"/>-->
<module name="UpperEll"/>

<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
<module name="SuppressionXpathFilter">
<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
default="checkstyle-xpath-suppressions.xml" />
<property name="optional" value="true"/>
</module>

</module>

</module>
Loading
Loading