Skip to content

Commit ec99e2c

Browse files
Merge pull request #93 from microsoft/release/serialization-json
Mono-repo updates for release
2 parents 024b6a1 + a56fc4e commit ec99e2c

20 files changed

+172
-176
lines changed

.github/dependabot.yml

-12
This file was deleted.

.github/workflows/auto-merge-dependabot.yml

-32
This file was deleted.

.github/workflows/create-release.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Tag & create GitHub release"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
create-tag:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
version: ${{ steps.get-version.outputs.VERSION }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Get lib version and set environment variable
24+
id: get-version
25+
run: |
26+
VERSION=$(grep 'VERSION' src/Constants.php | grep -oE '[0-9]+\.[0-9]+\.([0-9]+|[0-9]+-[a-z]+)')
27+
echo "VERSION=$VERSION" >> $GITHUB_ENV
28+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
29+
30+
- name: Create and publish tag
31+
run: |
32+
git tag $VERSION
33+
if [[ $? -ne 0 ]]; then
34+
echo "Tag $VERSION already exists. Skipping tag creation."
35+
exit 1
36+
fi
37+
git push origin $VERSION
38+
39+
create-release:
40+
needs: create-tag
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Github Release
45+
uses: taiki-e/create-gh-release-action@v1
46+
with:
47+
token: ${{ secrets.GITHUB_TOKEN}}
48+
ref: refs/tags/${{ needs.create-tag.outputs.version }}
49+
changelog: "CHANGELOG.md"

.github/workflows/pr-validation.yml

+1-30
Original file line numberDiff line numberDiff line change
@@ -27,41 +27,12 @@ jobs:
2727
coverage: none
2828
- name: Install dependencies
2929
run: composer install
30-
- name: Run static analysis
31-
run: ./vendor/bin/phpstan
32-
- name: Run tests without coverage
33-
run: ./vendor/bin/phpunit
34-
35-
code-coverage:
36-
runs-on: ubuntu-latest
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v4
40-
- name: Setup PHP and Xdebug for Code Coverage report
41-
uses: shivammathur/setup-php@v2
42-
with:
43-
php-version: '8.3'
44-
coverage: xdebug
45-
- name: Install dependencies
46-
run: composer install
47-
- name: Run static analysis
48-
run: ./vendor/bin/phpstan
49-
- name: Run tests with coverage
50-
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml
51-
- name: Fix code coverage paths
52-
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
53-
- name: SonarCloud Scan
54-
if: ${{ !github.event.pull_request.head.repo.fork }}
55-
uses: SonarSource/sonarcloud-github-action@master
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5930

6031
# The check-php-version-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
6132
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
6233
check-php-version-matrix:
6334
runs-on: ubuntu-latest
64-
needs: [build, code-coverage]
35+
needs: [build]
6536
if: always()
6637
steps:
6738
- name: All build matrix options are successful

.github/workflows/rerun-pr-checks.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Re-run checks on Release PRs"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
permissions:
13+
contents: write
14+
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
PR_URL: ${{ github.event.pull_request.html_url }}
18+
19+
jobs:
20+
rerun-checks:
21+
if: ${{ github.actor == 'microsoft-graph-devx-bot[bot]' }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
# Kiota Abstractions needs to be released first for PR checks to pass
28+
# We delay before re-running checks to ensure Abstractions is already released
29+
# We sleep before re-running checks to ensure the status checks have time to update (https://github.com/cli/cli/pull/2279#discussion_r513610296)
30+
# Fetching checks on recently created branches can return a false "no required checks reported on the ... branch" error
31+
- name: Delay and re-run checks
32+
run: |
33+
sleep 30
34+
needsRerun=$(gh pr checks $PR_URL --required --watch --json bucket --jq '.[] | select(.bucket != "pass") | .bucket')
35+
if [[ $needsRerun ]]; then
36+
sleep 300
37+
gh pr checks $PR_URL --required --json link --jq .[].link | grep -oP '/runs/\K\d+' | { read runId; gh run rerun $runId; }
38+
fi

CHANGELOG.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [1.5.0](https://github.com/microsoft/kiota-php/compare/microsoft-kiota-serialization-json-v1.4.0...microsoft-kiota-serialization-json-v1.5.0) (2025-02-10)
99

10-
### Added
1110

12-
### Changed
11+
### Features
12+
13+
* add kiota bundle ([575e3bc](https://github.com/microsoft/kiota-php/commit/575e3bc147dfcdd02128db5cad46b82959d3e38e))
14+
* add release please configuration to monorepo ([57de3a2](https://github.com/microsoft/kiota-php/commit/57de3a20091d1cd349d3c4b0e840920ac3a57d75))
15+
16+
17+
### Bug Fixes
18+
19+
* Json serialization tests namespace ([e80465e](https://github.com/microsoft/kiota-php/commit/e80465ea81e2fba6c524ce664a2fe18c867219d4))
20+
* removes call to addcslashes in getStringValue() functions ([f7097a1](https://github.com/microsoft/kiota-php/commit/f7097a1e13c71f5fe4246d61dc806ac7300412ea))
21+
* removes call to addcslashes in getStringValue() functions ([64db05d](https://github.com/microsoft/kiota-php/commit/64db05d895bf6e1b09462dbd184665a6e7b3a66f))
22+
* subproject config & CI ([673beef](https://github.com/microsoft/kiota-php/commit/673beef4ae3f99c94a7730bb3810d4a1abdf27d5))
1323

1424
## [1.3.1]
1525

README.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,20 @@ Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README
1414

1515
run `composer require microsoft/kiota-serialization-json` or add the following to your `composer.json` file:
1616

17-
```Shell
17+
```
1818
{
1919
"require": {
20-
"microsoft/kiota-serialization-json": "^1.3.0"
20+
// x-release-please-start-version
21+
"microsoft/kiota-serialization-json": "^1.5.0"
22+
// x-release-end
2123
}
2224
}
2325
```
2426

2527
## Contributing
2628

27-
This project welcomes contributions and suggestions. Most contributions require you to agree to a
28-
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
29-
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
30-
31-
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
32-
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
33-
provided by the bot. You will only need to do this once across all repos using our CLA.
34-
35-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
36-
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
37-
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
29+
This project welcomes contributions and suggestions. This project welcomes contributions and suggestions. Issues and pull requests should be made against the [kiota-php](https://github.com/microsoft/kiota-php/) repository.
30+
This repository is only used for releases.
3831

3932
## Trademarks
4033

composer.json

+37-35
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
{
2-
"name": "microsoft/kiota-serialization-json",
3-
"description": "Implementation of Kiota serialization abstractions using Json.",
4-
"authors": [
5-
{
6-
"name": "Microsoft Graph Client Tooling",
7-
"email": "[email protected]",
8-
"role": "Developer"
2+
"name": "microsoft/kiota-serialization-json",
3+
"description": "Implementation of Kiota serialization abstractions using Json.",
4+
"authors": [
5+
{
6+
"name": "Microsoft Graph Client Tooling",
7+
"email": "[email protected]",
8+
"role": "Developer"
9+
}
10+
],
11+
"license": [
12+
"MIT"
13+
],
14+
"autoload": {
15+
"psr-4": {
16+
"Microsoft\\Kiota\\Serialization\\Json\\": "src"
17+
}
18+
},
19+
"autoload-dev": {
20+
"psr-4": {
21+
"Microsoft\\Kiota\\Serialization\\Json\\Tests\\": "tests"
22+
}
23+
},
24+
"require": {
25+
"microsoft/kiota-abstractions": "^1.5.0",
26+
"guzzlehttp/psr7": "^1.6 || ^2",
27+
"php": "^7.4 || ^8.0",
28+
"ext-json": "*"
29+
},
30+
"require-dev": {
31+
"roave/security-advisories": "dev-latest",
32+
"phpunit/phpunit": "^9.6.22",
33+
"phpstan/phpstan": "^1.12.16"
34+
},
35+
"config": {
36+
"allow-plugins": {
37+
"php-http/discovery": false
38+
}
939
}
10-
],
11-
"license": ["MIT"],
12-
"autoload": {
13-
"psr-4": {
14-
"Microsoft\\Kiota\\Serialization\\Json\\": "src"
15-
}
16-
},
17-
"autoload-dev": {
18-
"psr-4": {
19-
"Microsoft\\Kiota\\Serialization\\Tests\\": "tests"
20-
}
21-
},
22-
"require": {
23-
"microsoft/kiota-abstractions": "^1.4.0",
24-
"guzzlehttp/psr7": "^1.6 || ^2",
25-
"php": "^7.4 || ^8",
26-
"ext-json": "*"
27-
},
28-
"require-dev": {
29-
"roave/security-advisories": "dev-latest",
30-
"phpunit/phpunit": "^8 || ^9",
31-
"phpstan/phpstan": "^1.4"
32-
},
33-
"config": {
34-
"allow-plugins": {
35-
"php-http/discovery": false
36-
}
37-
}
3840
}

phpstan.neon

-9
This file was deleted.

phpunit.xml

-20
This file was deleted.

sonar-project.properties

-5
This file was deleted.

src/Constants.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44

55
final class Constants
66
{
7-
public const VERSION = '1.0.1';
7+
// x-release-please-start-version
8+
public const VERSION = '1.5.0';
9+
// x-release-please-end
810
}

src/JsonParseNode.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getChildNode(string $identifier): ?ParseNode {
5353
* @inheritDoc
5454
*/
5555
public function getStringValue(): ?string {
56-
return is_string($this->jsonNode) ? addcslashes($this->jsonNode, "\\\r\n") : null;
56+
return is_string($this->jsonNode) ? $this->jsonNode : null;
5757
}
5858

5959
/**

tests/JsonParseNodeFactoryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Microsoft\Kiota\Serialization\Tests;
3+
namespace Microsoft\Kiota\Serialization\Json\Tests;
44

55
use GuzzleHttp\Psr7\Utils;
66
use InvalidArgumentException;

0 commit comments

Comments
 (0)