Skip to content
Open
15 changes: 15 additions & 0 deletions .github/workflows/generate-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ jobs:

echo "DIFF_IS_EMPTY=$([[ -z "$diff_excluding_submodule" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV

# Save full diff to file and upload artifact
Copy link
Contributor

Choose a reason for hiding this comment

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

I recognize this as a workaround, but do you encounter a diff when executing the steps written in the workflow locally?

# Install openapi-generator-cli
- run: echo "OPENAPI_GENERATOR_VERSION=7.11.0" >> $GITHUB_ENV
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
id: openapi-generator-cache
env:
cache-name: openapi-generator-cache
with:
path: ~/bin/openapitools
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.OPENAPI_GENERATOR_VERSION }}
- if: steps.openapi-generator-cache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/bin/openapitools
curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli
chmod u+x ~/bin/openapitools/openapi-generator-cli
export PATH=$PATH:~/bin/openapitools/
OPENAPI_GENERATOR_VERSION=${{ env.OPENAPI_GENERATOR_VERSION }} openapi-generator-cli version
- name: Generate codes
run: |
export PATH=$PATH:~/bin/openapitools/
bash tools/gen-oas-client.sh
- name: Update document
run: |
wget https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.3.1/phpDocumentor.phar
php phpDocumentor.phar run -d src -t docs

If so, this might confuse external contributors too like you, and we should consider measures to ensure stricter version control. For example, https://github.com/line/line-bot-sdk-php/blob/master/CONTRIBUTING.md should be updated.

.... However, since CI provides stable results, could it be that your local version is misaligned...?
@eucyt might help you when you're confused with something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems the PHP version I was running locally was outdated. The issue is now resolved, but I plan to keep this change for future troubleshooting.

- name: Save full diff to file
if: env.DIFF_IS_EMPTY != 'true'
run: |
git --no-pager diff HEAD > diff.patch
echo "Full diff saved to diff.patch"

- name: Upload diff artifact
if: env.DIFF_IS_EMPTY != 'true'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: codegen-diff
path: diff.patch

## Run if diff exists and pull request or merge queue, and make CI status failure (but allow renovate bot)
- if: >-
${{
Expand Down
374 changes: 374 additions & 0 deletions docs/classes/LINE-Parser-EventRequestOptions.html

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions docs/classes/LINE-Parser-EventRequestParser.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ <h4 class="phpdocumentor-element__name" id="method_parseEventRequest">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/parser/lib/EventRequestParser.php"><a href="files/src-parser-lib-eventrequestparser.html"><abbr title="src/parser/lib/EventRequestParser.php">EventRequestParser.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">43</span>
<span class="phpdocumentor-element-found-in__line">44</span>

</aside>

<p class="phpdocumentor-summary">Validate signature and parse Webhook event request.</p>

<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">parseEventRequest</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$body</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$channelSecret</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$signature</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/LINE-Parser-ParsedEvents.html"><abbr title="\LINE\Parser\ParsedEvents">ParsedEvents</abbr></a></span></code>
<span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">parseEventRequest</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$body</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$channelSecret</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$signature</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/LINE-Parser-EventRequestOptions.html"><abbr title="\LINE\Parser\EventRequestOptions">EventRequestOptions</abbr></a>|null&nbsp;</span><span class="phpdocumentor-signature__argument__name">$options</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/LINE-Parser-ParsedEvents.html"><abbr title="\LINE\Parser\ParsedEvents">ParsedEvents</abbr></a></span></code>

<section class="phpdocumentor-description"><p>When discriminator is not unknown, Webhook event will be parsed to the corresponding superclass.
For example, <code class="prettyprint">&quot;type&quot;:&quot;unknown&quot;</code> will be parsed to LINE\Webhook\Model\Event and
Expand Down Expand Up @@ -249,6 +249,15 @@ <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
</dt>
<dd class="phpdocumentor-argument-list__definition">

</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$options</span>
: <span class="phpdocumentor-signature__argument__return-type"><a href="classes/LINE-Parser-EventRequestOptions.html"><abbr title="\LINE\Parser\EventRequestOptions">EventRequestOptions</abbr></a>|null</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>Options for event request parsing</p>
</section>

</dd>
</dl>

Expand Down
89 changes: 83 additions & 6 deletions docs/classes/LINE-Parser-Tests-EventRequestParserTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h2 class="phpdocumentor-content__title">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/parser/test/EventRequestParserTest.php"><a href="files/src-parser-test-eventrequestparsertest.html"><abbr title="src/parser/test/EventRequestParserTest.php">EventRequestParserTest.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">31</span>
<span class="phpdocumentor-element-found-in__line">32</span>

</aside>

Expand Down Expand Up @@ -181,6 +181,13 @@ <h3 id="toc">
<span>
&nbsp;: void </span>
</dt>
<dd></dd>

<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/LINE-Parser-Tests-EventRequestParserTest.html#method_testParseEventRequestWithSkipSignatureValidation">testParseEventRequestWithSkipSignatureValidation()</a>
<span>
&nbsp;: void </span>
</dt>
<dd></dd>

<dt class="phpdocumentor-table-of-contents__entry -method -private">
Expand Down Expand Up @@ -218,7 +225,7 @@ <h4 class="phpdocumentor-element__name" id="property_json">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/parser/test/EventRequestParserTest.php"><a href="files/src-parser-test-eventrequestparsertest.html"><abbr title="src/parser/test/EventRequestParserTest.php">EventRequestParserTest.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">33</span>
<span class="phpdocumentor-element-found-in__line">34</span>

</aside>

Expand Down Expand Up @@ -1095,7 +1102,7 @@ <h4 class="phpdocumentor-element__name" id="property_json">
&quot;deliveryContext&quot;: {
&quot;isRedelivery&quot;: false
},
&quot;replyToken&quot;: &quot;replytoken&quot;
&quot;replyToken&quot;: &quot;replytoken&quot;
},
{
&quot;type&quot;: &quot;membership&quot;,
Expand All @@ -1113,7 +1120,7 @@ <h4 class="phpdocumentor-element__name" id="property_json">
&quot;deliveryContext&quot;: {
&quot;isRedelivery&quot;: false
},
&quot;replyToken&quot;: &quot;replytoken&quot;
&quot;replyToken&quot;: &quot;replytoken&quot;
}
]
}
Expand Down Expand Up @@ -1147,7 +1154,7 @@ <h4 class="phpdocumentor-element__name" id="method_testParseEventRequest">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/parser/test/EventRequestParserTest.php"><a href="files/src-parser-test-eventrequestparsertest.html"><abbr title="src/parser/test/EventRequestParserTest.php">EventRequestParserTest.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">931</span>
<span class="phpdocumentor-element-found-in__line">932</span>

</aside>

Expand All @@ -1159,6 +1166,76 @@ <h4 class="phpdocumentor-element__name" id="method_testParseEventRequest">



<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/LINE-Parser-Exception-InvalidEventRequestException.html"><abbr title="\LINE\Parser\Exception\InvalidEventRequestException">InvalidEventRequestException</abbr></a></span>


</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/LINE-Parser-Exception-InvalidEventSourceException.html"><abbr title="\LINE\Parser\Exception\InvalidEventSourceException">InvalidEventSourceException</abbr></a></span>


</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/LINE-Parser-Exception-InvalidSignatureException.html"><abbr title="\LINE\Parser\Exception\InvalidSignatureException">InvalidSignatureException</abbr></a></span>


</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><abbr title="\JsonException">JsonException</abbr></span>


</dd>
</dl>

<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">void</span>
&mdash;


</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_testParseEventRequestWithSkipSignatureValidation">
testParseEventRequestWithSkipSignatureValidation()
<a href="classes/LINE-Parser-Tests-EventRequestParserTest.html#method_testParseEventRequestWithSkipSignatureValidation" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/parser/test/EventRequestParserTest.php"><a href="files/src-parser-test-eventrequestparsertest.html"><abbr title="src/parser/test/EventRequestParserTest.php">EventRequestParserTest.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">1730</span>

</aside>


<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">testParseEventRequestWithSkipSignatureValidation</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>




<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
Expand Down Expand Up @@ -1217,7 +1294,7 @@ <h4 class="phpdocumentor-element__name" id="method_getSignature">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/parser/test/EventRequestParserTest.php"><a href="files/src-parser-test-eventrequestparsertest.html"><abbr title="src/parser/test/EventRequestParserTest.php">EventRequestParserTest.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">1718</span>
<span class="phpdocumentor-element-found-in__line">1719</span>

</aside>

Expand Down
Loading