Skip to content
This repository was archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Releasing refs/heads/release/2.0.0 into master (#163)
Browse files Browse the repository at this point in the history
* Resolve #119 (wrong email in license text)

* develop branch to depend on develop branch

* Update dependency situation

* fixing stability

* add release script

* fix release script

* Added release notes for 1.1.3

* fix release script

* fix release script

* fix release script

* add YEY message for future releases ;)

* fix broken URL link

* rrrgh!!!

* drop php 5.5 and upgrade phpunit

* Added release notes for 1.1.4

* minmor change in release script

* Apply fixes from StyleCI

* Added release notes for 1.1.5

* Update Expression.php

* Apply fixes from StyleCI

* Update Expression.php

* add php 7.2 testing

* Add support for mysql://user:pass@host/db (#120)

* Add verification for foreign objects inside where() values (#122)

* Add verification for foreign objects inside where() values

* Apply fixes from StyleCI

* Feature/oracle support (#124)

* Reference implementation (untested)

* Apply fixes from StyleCI

* bugfix

* Apply fixes from StyleCI

* Cleanup and split up support for regular an 12c oracle

* ok, some first results

* Apply fixes from StyleCI

* Merge

* Add more tests

* Apply fixes from StyleCI

* add 2 more tests

* add test for field alias escaping

* fix issues around rownum aliasing

* add common methods into common parent class

* Apply fixes from StyleCI

* added clarification why we only use "NEXT"

* typo

* fix FIRST/NEXT in tests

* - introduce Expression::escape_char
- make " as default escape char
- make MySQL as exception to standard SQL escaping not vice versa
- clean up code duplication in Oracle classes
- change tests accordingly

* more duplicated code

* For consistency with table render move field_noalias into generic Query class.

* few fixes for oracle 12c limit

* Apply fixes from StyleCI

* happy with implementation

* address Romans review

* Fix expr().

Basically it's all about expr() method which looses it's parent class and Query_MySQL->expr() for example never know that it should return Expression_MySQL not Expression class instance. In case we have Connection (not PDO) then we can get that info from Connection, because Connection class is/should be the one responsible for that. If we don't have Connection, but only PDO, then wehave to make "smart" quess (anyway that's not worse than it's now).

* Apply fixes from StyleCI

* spellcheck and wrapping :) (#125)

* fix Limit for Oracle <12

* fix oracle test

* Create a driver for postgresql

* Code style fix

* Code style fix

* Enable testing in postgresql on travis

* Postgresql doesn't support REPLACE.

* Fix: When creating database for postgresql, identifiers containing - should be quoted

* Fix: SQL does not guarantee the order of retreived rows unless explic… (#131)

* Fix: SQL does not guarantee the order of retreived rows unless explicitly ordered

* Fix code-style

* Feature/connection oracle (#132)

* * new connection for Oracle <12
* new connection for Oracle 12 (not fully ok yet)

* Apply fixes from StyleCI

* to much "return" statements

* Fix tests to run on both mysql and postgresql

* Use lowest supported version of postgresql to test against. (9.3). Default on travis is 9.1 it seems

* With debug-info to track error when run on travis ...

* Fix testExpression() to work on both mysql and pgsql.

* Apply fixes from StyleCI

* typo fix

* * fix bug with uppercase field names
* refactor and fix lastInsertID
* fix date format issue for Oracle
* fix number format issue for Oracle
* move PgSQL connection to separate class for consistency

* Apply fixes from StyleCI

* don't use select max(id) for now.

* Added release notes for 1.2.0

* fix expr()

* rollback

* proper fix for expr()

* Fix: If  is already an instance of PDO, don't just assume mysql

* Fix: If a \PDO instance is passed to connect(), setup according to database type, and don't just assume it to be mysql

* Fix: Missing break

* Make a separate test-class for when using PDO-connections to connect()

* Fix code style

* Fix style

* resolve #136

* Added release notes for 1.2.1

* implement CASE and add full test coverage

* add one more test case and documentation

* Apply fixes from StyleCI

* rename method else() to otherwise() because PHP 5.6 restricts to use reserved names in method name.

* * implement normalizeDSN()
* Connection now use normalizeDSN()
* test coverage

P.S. normalizeDSN() will also be used in \atk4\data\Persistence to avoid code duplication between repos.

* Added release notes for 1.2.2

* * user and password arguments should take precedence
* and dsn string should still be normalized

* make reasonable defaulcts

* * use only core classes for testing
* with one exception (for now) PHPUnit_Extensions_Database_TestCase

* Added release notes for 1.2.3

* Update README.md

* add resource support (#142)

* more informative exception

* support LOB fields - uzse bindParam + 4th parameter trick

* Apply fixes from StyleCI

* Added release notes for 1.2.4

* fix Oracle session timestamp and date format

* Remove restriction for custom ordering keyword because some DB engines like Oracle can have order statement like this: ORDER BY name DESC NULLS LAST (#145)

* add support for port number in DSN connection string

* support DSN as object

* Apply fixes from StyleCI

* fix compatibility with php5

* add test for port number

* make args public (#147)

* Added release notes for 1.2.5

* fix PHPDoc comments

* add comments, make code consistant

* update docs

* code coverage

* travis fix

* coverage

* Update .travis.yml

* Update .travis.yml

* Update phpunit.xml

* Update phpunit-mysql.xml

* Update phpunit-pgsql.xml

* proper method name

* cleanup

* Update README.md

* Update README.md

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Add support for groupConcat() (#149)

* Add support for groupConcat()

* Apply fixes from StyleCI

* adds comments

* add tests

* Apply fixes from StyleCI

* add docs

* update docs

* add test for expr()

* re-add tests (Random) which I renamed (#150)

* re-add tests (Random) which I renamed

* Apply fixes from StyleCI

* fix DSN normalization for port

* fix test

* only normalize port if it's passed as part of URL

* add interface for ResultSet - something ATK Data can return from action()

* whops, forgot file

* Apply fixes from StyleCI

* add documentation for $q->options() (#153)

* Added release notes for 1.2.6

* add Connection->driver property (#157)

* Use github actions for DSQL (#162)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Apply fixes from StyleCI

* trigger bulid

* wip

* wip

* Improve release process - create PR automatically

* Setting current dependencies
  • Loading branch information
github-actions[bot] authored and romaninsh committed Dec 2, 2019
1 parent 045322b commit 6ad9eab
Show file tree
Hide file tree
Showing 51 changed files with 2,655 additions and 799 deletions.
168 changes: 118 additions & 50 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,120 @@
engines:
duplication:
enabled: true
config:
languages:
- php
fixme:
enabled: true
version: "2"
plugins:
# Disabling plugins until there is a reasonable way to sanitize their output
phpcodesniffer:
enabled: false
config:
standard: "PSR1,PSR2"
ignore_warnings: true
encoding: utf-8
phpmd:
enabled: true
exclude_fingerprints:
- 9d462b7c90c564bf28007ee399340fad # table() NPath is too complex.
- c96f14f28e3586694e93ad4a7185804a # we use static for factory, so it's good
- e4eedf458a989182e975f6cd334d2d12 # we exit from toStrign() because it can't throw exceptions
- 31780bbd56396145ce17ca6e15095d99 # ignore Single Responsibility Principle in this case
checks:
CyclomaticComplexity:
enabled: false
Design/TooManyPublicMethods:
enabled: false
Design/TooManyMethods:
enabled: false
Design/NpathComplexity:
enabled: false
Design/WeightedMethodCount:
enabled: false
Design/LongClass:
enabled: false
Controversial/CamelCaseMethodName:
enabled: false
Controversial/CamelCaseParameterName:
enabled: false
Controversial/CamelCasePropertyName:
enabled: false
Controversial/CamelCaseVariableName:
enabled: false
Controversial/CamelCaseClassName:
enabled: false
Naming/ShortVariable:
enabled: false
CleanCode/ElseExpression:
enabled: false
enabled: false
sonar-php:
enabled: false

checks:
argument-count:
config:
threshold: 4
complex-logic:
config:
threshold: 4
file-lines:
config:
threshold: 1000
method-complexity:
config:
threshold: 40
method-count:
config:
threshold: 40
method-lines:
config:
threshold: 100
nested-control-flow:
config:
threshold: 4
return-statements:
config:
threshold: 4
similar-code:
config:
threshold: 100
identical-code:
config:
threshold: 150


radon:
enabled: true
ratings:
paths:
- src/**
exclude_paths:
- docs/**/*
- tests/**/*
- vendor/**/*
#engines:
# duplication:
# enabled: true
# config:
# languages:
# php:
# mass_threshold: 50
# fixme:
# enabled: true
# phpmd:
# enabled: true
# exclude_fingerprints:
# - 9d462b7c90c564bf28007ee399340fad # table() NPath is too complex.
# - 7c90035f65bb3bdbd2c03c648a705aac # we use static for factory, so it's good
# - 80ef7f404dd4f054ca51d9ee12d9e9dd # we exit from toStrign() because it can't throw exceptions
# - ae61f5e0cda0328c140f3b7298dbb8af # don't complain about call to static connection, as it's a fallback
# - e71149b967391adfaf3347a53d3c0023 # don't complain about $junk used in foreach when we only need keys
# checks:
# CyclomaticComplexity: # because we solve complex stuff
# enabled: false
# Naming/LongVariable: # because we have variable naming patterns
# enabled: false
# UnusedFormalParameter: # because when we extend methods/hooks we wish to keep unified method call interface
# enabled: false
# Design/TooManyPublicMethods: # because we follow our internal design patters
# enabled: false
# Design/TooManyMethods: # because we solve complex stuff
# enabled: false
# Design/LongMethod: # because methods are as long as we need them to be
# enabled: false
# ExcessivePublicCount: # because Model has too many public methods
# enabled: false
# Design/TooManyFields: # because we solve complex things
# enabled: false
# Design/NpathComplexity: # because splitting up complex stuff into methods makes things even more complex
# enabled: false
# Design/WeightedMethodCount: # because we we solve complex stuff
# enabled: false
# Design/LongClass: # because we design carefully what is native and what is extension
# enabled: false
# Controversial/CamelCaseMethodName: # because we need certain method naming patterns, render_blah for rendering [blah]
# enabled: false
# Controversial/CamelCaseParameterName: #
# enabled: false
# Controversial/CamelCasePropertyName: # because we use _better_dont_change properties
# enabled: false
# Controversial/CamelCaseVariableName: #
# enabled: false
# Controversial/CamelCaseClassName: # Because we use Join_SQL where we specifically include _
# enabled: false
# Naming/ShortVariable: # because sometimes variables should be short
# enabled: false
# CleanCode/ElseExpression: # because following this makes code more complex
# enabled: false
#
# radon:
# enabled: true
#ratings:
# paths:
# - "src/**"
#exclude_paths:
#- "docs/**"
#- "tests/**"
#- "vendor/**"
## exclude obsolete classes
#- "src/Field_Many.php"
#- "src/Field_One.php"
#- "src/Field_SQL_One.php"
#- "src/Relation_Many.php"
#- "src/Relation_One.php"
#- "src/Relation_SQL_One.php"
## exclude classes completely inherited from other repos
#- "src/Exception.php"
9 changes: 9 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://github.com/release-drafter/release-drafter#configuration
categories:
- title: 'Enhancements'
labels:
- enhancement
template: |
## What’s Changed
$CHANGES
43 changes: 43 additions & 0 deletions .github/workflows/bundler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Bundler

on: create

jobs:
autocommit:
name: Update to stable dependencies
if: startsWith(github.ref, 'refs/heads/release/')
runs-on: ubuntu-latest
container:
image: atk4/image:latest # https://github.com/atk4/image
steps:
- uses: actions/checkout@master
- run: echo ${{ github.ref }}
- name: Update to stable dependencies
run: |
jq 'del(.require["atk4/core"])' < composer.json > tmp && mv tmp composer.json
composer require atk4/core
composer update
- uses: teaminkling/autocommit@master
with:
commit-message: Setting current dependencies
- uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: pull-request
uses: repo-sync/pull-request@v2
with:
source_branch: "" # If blank, default: triggered branch
destination_branch: "master" # If blank, default: master
pr_title: "Releasing ${{ github.ref }} into master"
pr_body: |
- [ ] Review changes (must include stable dependencies)
- [ ] Merge this PR into master (will delete ${{ github.ref }})
- [ ] Go to Releases and create TAG from master
Do not merge master into develop
pr_reviewer: "romaninsh"
pr_assignee: "romaninsh"
github_token: ${{ secrets.GITHUB_TOKEN }}

16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- develop

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: toolmantim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 changes: 69 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Unit Testing

on:
pull_request:
branches: '*'
push:
branches:
- master
- develop

jobs:
unit-test:
name: Unit Testing
runs-on: ubuntu-latest
container:
image: atk4/image:${{ matrix.php }} # https://github.com/atk4/image
strategy:
matrix:
php: ['7.2', '7.3', 'latest']
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
DB_DATABASE: dsql_test
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
postgres:
image: postgres:10-alpine
env:
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v1
- run: php --version
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Run Tests
run: |
mkdir -p build/logs
mysql -uroot -ppassword -h mysql -e 'CREATE DATABASE dsql_test;'
PGPASSWORD=password psql -h postgres -c 'create database "atk4-dsql-test";' -U postgres
- name: SQLite Testing
run: vendor/bin/phpunit --configuration phpunit.xml --coverage-text --exclude-group dns

- name: MySQL Testing
run: vendor/bin/phpunit --configuration phpunit-mysql.xml --exclude-group dns

- name: PgSQL Testing (expected errors)
run: vendor/bin/phpunit --configuration phpunit-pgsql.xml --exclude-group dns || echo 'ignoring errors..'

- name: Merge coverage logs
run: vendor/bin/phpcov merge build/logs/ --clover build/logs/cc.xml;

- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: build/logs/cc.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ docs/build
/composer.lock
/vendor
.DS_Store
.idea
25 changes: 20 additions & 5 deletions .travis.yml → .old.travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
language: php

php:
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'

cache:
directories:
- $HOME/.composer/cache

addons:
postgresql: "9.3"

services:
- mysql
- postgresql

before_script:
- composer self-update
- composer install --no-ansi
- mysql -e 'create database dsql_test;'
- psql -c 'create database "atk4-dsql-test";' -U postgres
- mkdir -p build/logs

script:
#- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then CM="phpdbg -qrr"; NC=""; else CM=""; NC="--no-coverage"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then CM=""; NC=""; else CM=""; NC="--no-coverage"; fi
- $CM ./vendor/bin/phpunit $NC
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then CM=""; NC=""; else CM=""; NC="--no-coverage"; fi
- $CM ./vendor/bin/phpunit --configuration phpunit.xml $NC
- $CM ./vendor/bin/phpunit --configuration phpunit-mysql.xml $NC
- $CM ./vendor/bin/phpunit --configuration phpunit-pgsql.xml $NC

after_script:
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then vendor/bin/phpcov merge build/logs/ --clover cc.xml; vendor/bin/test-reporter --coverage-report cc.xml; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then
echo "Merging coverage reports:";
vendor/bin/phpcov merge build/logs/ --clover build/logs/cc.xml;
echo "We now have these coverage files:";
ls -l build/logs;
echo "Sending codeclimate report:";
vendor/bin/test-reporter --coverage-report build/logs/cc.xml;
echo "Sending codecov report:";
TRAVIS_CMD="" bash <(curl -s https://codecov.io/bash) -f build/logs/cc.xml;
fi

notifications:
urls:
Expand Down
Loading

0 comments on commit 6ad9eab

Please sign in to comment.