Skip to content

Commit

Permalink
Merge branch 'atlassian-api:master' into download_attachments_from_page
Browse files Browse the repository at this point in the history
  • Loading branch information
gkowalc authored Dec 11, 2023
2 parents 359530d + 3e1ef05 commit 37dc453
Show file tree
Hide file tree
Showing 109 changed files with 11,095 additions and 1,094 deletions.
4 changes: 2 additions & 2 deletions .github/bump_version
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [[ ( -z ${1+x} ) || ( -z ${2+x} ) ]]; then
cat << EOF
usage: $(basename ${0}) repo increment
usage: $(basename "${0}") repo increment
Quick and dirty version bump script
If a variable "BUILD_VERSION" is set, returns that variable as is
Expand Down Expand Up @@ -30,7 +30,7 @@ function autoversion(){
BUILD_NUMBER="0" # In the developer machine, this will build x.y.z.dev0
fi

cd ${REPO_PATH} || exit 1
cd "${REPO_PATH}" || exit 1

git fetch --tags 2>/dev/null
last_tag=$(git tag | sort -Vr | head -1)
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '28 18 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
30 changes: 15 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.11', '3.12' ]

steps:
- uses: actions/checkout@v2
- name: Build Docker
run: |
make docker-qa-build PYTHON_VERSION=${{matrix.python-version}}
- name: Run Docker
run: |
.github/bump_version ./ minor > atlassian/VERSION
make docker-qa PYTHON_VERSION=${{matrix.python-version}}
- name: Creating coverage report
if: ${{ ( matrix.python-version == '3.8' ) }}
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
fail_ci_if_error: true
- uses: actions/checkout@v3
- name: Build Docker
run: |
make docker-qa-build PYTHON_VERSION=${{matrix.python-version}}
- name: Run Docker
run: |
.github/bump_version ./ minor > atlassian/VERSION
make docker-qa PYTHON_VERSION=${{matrix.python-version}}
- name: Creating coverage report
if: ${{ ( matrix.python-version == '3.8' ) }}
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: true
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# PyCharm
.idea
.sonarlint
.pytest_cache
Expand Down Expand Up @@ -116,6 +117,9 @@ venv_/

#
*.secret

.secrets/
#visual studio code
.vscode
.vscode

Pipfile
Pipfile.lock
57 changes: 46 additions & 11 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,28 @@ Getting Started
* Keep it sync_'ed while you are developing
* Install pyenv_
* Install related atlassian product for testing through SDK_ or use the cloud instance
* ``pip install -r requirements-dev.txt``
* `apt install libkrb5-dev`
* Install Kerberos Dependency:

::

pip install -r requirements-dev.txt

* Start up related product:
- Standalone product atlas-run-standalone_
- For cloud product, just do registration
* Run the quality checks with `make qa` or if you have docker installed with `make docker-qa`
- Standalone product atlas-run-standalone_
- For cloud product, just do registration
- Atlassian SDK in doker
- Build the image
::

make docker-atlassian-standalone

- Run an Atlassian standalone product
::

docker run -i -t -p 6990:6990 atlassian-sdk:latest atlas-run-standalone --product bamboo

* Run the quality checks with `make qa` or if you have docker installed with `make docker-qa`
* Send pull request

.. _Fork: https://help.github.com/articles/fork-a-repo/
Expand All @@ -25,6 +42,7 @@ Getting Started
.. _SDK: https://developer.atlassian.com/server/framework/atlassian-sdk/downloads/
.. _atlas-run-standalone: https://developer.atlassian.com/server/framework/atlassian-sdk/atlas-run-standalone/


Mandatory conditions
--------------------

Expand All @@ -34,7 +52,7 @@ Mandatory conditions

Please follow the code style in the docs.

.. _black: https://black.readthedocs.io/en/stable/editor_integration.html
.. _black: https://black.readthedocs.io/en/stable/integrations/editors.html

Connect on Chat for any queries
---------------------------------
Expand All @@ -50,7 +68,7 @@ Before you raise a PR
Create the **Commit Header** with the relevant Service Name pre-fixed, examples below,

* Jira: review user module :heavy_check_mark:
* [JIRA] Issues Move to Sprint :heavy_check_mark:
* [Jira] Issues Move to Sprint :heavy_check_mark:
* Confluence: update_page_property method :heavy_check_mark:

An example of a commit message header,
Expand All @@ -59,7 +77,7 @@ An example of a commit message header,

could be better written as,

* [JIRA] Project Issues parameter addition for start and limit :heavy_check_mark:
* [Jira] Project Issues parameter addition for start and limit :heavy_check_mark:

with the commit body have a detail about where/what changes introduced.

Expand All @@ -84,6 +102,14 @@ The following command builds a package and uploads it to PIP repository.

python setup.py sdist upload

Alternative way

::

python -m pip install build twine
python -m build
twine upload dist/*

An alternative way you can use next command

::
Expand All @@ -99,6 +125,9 @@ All methods based on docs from: https://developer.atlassian.com/docs/
* Jira
- `Jira Server`_
- `Jira Cloud`_
* Jira Software
- `Jira Software Server`_
- `Jira Software Cloud`_
* Jira Service Desk
- `Jira Service Desk Server`_
- `Jira Service Desk Cloud`_
Expand All @@ -108,14 +137,17 @@ All methods based on docs from: https://developer.atlassian.com/docs/
* Crowd
- `Crowd Server`_
* Advanced Roadmaps (formerly Portfolio for Jira)
- `Portfolio for Jira`_
- `Portfolio for Jira Teams`_
- `Portfolio for Jira`_ - Advanced Roadmaps
- `Portfolio for Jira Teams`_ - Advanced Roadmaps
* Insight
- `Insight Server`_ - Insight for Jira on-premises installation
- `Insight Cloud`_ - Insight for Jira in Atlassian Cloud
* Bitbucket:
- https://developer.atlassian.com/server/bitbucket/reference/rest-api/
- https://developer.atlassian.com/server/bitbucket/how-tos/command-line-rest/
- https://developer.atlassian.com/bitbucket/api/2/reference/resource/
* Bamboo:
- https://docs.atlassian.com/atlassian-bamboo/REST/latest/
- https://developer.atlassian.com/server/bamboo/rest/
* Tempo:
- https://www.tempo.io/server-api-documentation
- http://tempo.io/doc/core/api/rest/latest/
Expand All @@ -133,14 +165,17 @@ All methods based on docs from: https://developer.atlassian.com/docs/

.. _`Jira Server`: https://docs.atlassian.com/software/jira/docs/api/REST/latest
.. _`Jira Cloud`: https://developer.atlassian.com/cloud/jira/platform/rest/v3/
.. _`Jira Software Server`: https://docs.atlassian.com/jira-software/REST/latest/
.. _`Jira Software Cloud`: https://developer.atlassian.com/cloud/jira/software/rest/
.. _`Confluence Server`: https://developer.atlassian.com/server/confluence/confluence-server-rest-api/
.. _`Confluence Cloud`: https://developer.atlassian.com/cloud/confluence/rest/
.. _`Crowd Server`: https://developer.atlassian.com/server/crowd/crowd-rest-apis/
.. _`Jira Service Desk Cloud`: https://developer.atlassian.com/cloud/jira/service-desk/rest/
.. _`Jira Service Desk Server`: https://docs.atlassian.com/jira-servicedesk/REST/server
.. _`Portfolio for Jira Teams`: https://docs.atlassian.com/portfolio-for-jira-server/REST/2.13.0/teams/
.. _`Portfolio for Jira`: https://docs.atlassian.com/portfolio-for-jira-server/REST/2.13.0/jpo/

.. _`Insight Server`: https://insight-javadoc.riada.io/insight-javadoc-8.6/insight-rest/
.. _`Insight Cloud`: https://developer.atlassian.com/cloud/insight/rest/api-group-objectschema/#api-objectschema-list-get

Credits
-------
Expand Down
45 changes: 41 additions & 4 deletions Dockerfile.qa
Original file line number Diff line number Diff line change
@@ -1,19 +1,54 @@
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive
ARG PYTHON_VERSION

# Install add-apt-repository
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt install -y software-properties-common

# Install python development
# Add python repo
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install -y python$PYTHON_VERSION-dev python3-pip

# Install apt-utils
RUN apt install -y apt-utils

# install setuptools
RUN if [ $PYTHON_VERSION = '2.7' ] ; then \
apt install -y python-setuptools -reinstall ;\
else \
apt install -y python3-setuptools ;\
fi

# Install python development
RUN apt install -y \
python$PYTHON_VERSION-dev \
python3-pip

# install distutils.util
RUN if [ $PYTHON_VERSION = '3.7' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ;\
elif [ $PYTHON_VERSION = '3.6' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ;\
elif [ $PYTHON_VERSION = '3.10' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ; \
curl -sS https://bootstrap.pypa.io/get-pip.py | python$PYTHON_VERSION ; \
elif [ $PYTHON_VERSION = '3.11' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ; \
curl -sS https://bootstrap.pypa.io/get-pip.py | python$PYTHON_VERSION ; \
elif [ $PYTHON_VERSION = '3.12' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ; \
curl -sS https://bootstrap.pypa.io/get-pip.py | python$PYTHON_VERSION ; \
else \
apt install -y python3-distutils python3-distutils-extra python3-apt --reinstall ; \
fi

# Register the version in alternatives
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python$PYTHON_VERSION 1

# Install kerberos development
RUN apt-get install -y libkrb5-dev
RUN apt install -y libkrb5-dev

# Clean
RUN apt-get clean
Expand All @@ -22,7 +57,9 @@ RUN apt-get clean
WORKDIR /atlassian-python-api
COPY requirements.txt .
COPY requirements-dev.txt .
RUN python3 -m pip install --no-cache-dir --upgrade setuptools
RUN python3 -m pip install --no-cache-dir --upgrade pip
RUN python3 -m pip install --no-cache-dir --upgrade wheel
RUN python3 -m pip install --no-cache-dir -r requirements-dev.txt

ENV PYTHON_VERSION=$PYTHON_VERSION
Expand Down
17 changes: 17 additions & 0 deletions Dockerfile.standalone
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM openjdk:11

ARG DEBIAN_FRONTEND=noninteractive

# Add Atlassian SDK repo
RUN echo "deb https://packages.atlassian.com/debian/atlassian-sdk-deb/ stable contrib" >>/etc/apt/sources.list \
&& wget https://packages.atlassian.com/api/gpg/key/public \
&& apt-key add public \
&& apt-get update

# Install Atlassian plugin SDK
RUN apt install -y atlassian-plugin-sdk

# Clean
RUN apt-get clean

WORKDIR /opt/atlassian
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2014 Mateusz Harasymczuk
Copyright 2014 Mateusz Harasymczuk, Gonchik Tsymzhitov

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ include atlassian/VERSION
include LICENSE
include README.rst
include tox.ini
include requirements.txt
include requirements.txt
recursive-include tests *
Loading

0 comments on commit 37dc453

Please sign in to comment.