fix: Detected code that calls async_forward_entry_setup
Fixes #1020
Change async_setup_entry to use await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
It seems like CI pipelines fail. Any idea?
It seems like CI pipelines fail. Any idea?
All those checks are new to me! I forked the repo like I've done with others in the past, made my change and submitted the PR. I've really no idea at this point what to do. The readme failure seems to be an issue with your repository? Something/something.git returned 403? As for the yaml test failure, I dunno...
FAILED tests/components/adaptive_lighting/test_config_flow.py::test_changing_options_when_using_yaml[pyloop]
Seems like the unit tests need to be modified. If it was up to me, I wouldn't be testing anything older than a year. That means 2023.8 would be the oldest supported version. Maybe even 6 months, since this is a custom integration after all. If people want newer versions they have to keep up with HA as well...
And secondly, something is off with this piece of code https://github.com/basnijholt/adaptive-lighting/actions/runs/10209741520/workflow?pr=1029:
- name: Push changes
if: env.commit_status == 'committed'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
Perhaps your github token expired @basnijholt
FAILED tests/components/adaptive_lighting/test_config_flow.py::test_changing_options_when_using_yaml[pyloop]
It this integration were mine, I'd deprecate using yaml config and adopt config_flow only configuration like the majority of integrations have done (HA included).
Only two more releases before this deprecation becomes live in HA, Can this PR be merged or are changes still required?
Only two more releases before this deprecation becomes live in HA, Can this PR be merged or are changes still required?
I'll try a new fork and merge since I know quite a bit more about this side of things than I did 4 months ago...
@basnijholt This looks looks different to me from 4 months ago and looks it might succeed now if you approve the workflows? 🤷
It seems like CI pipelines fail. Any idea?
Hi @basnijholt , Could you please approve the pending workflows for this pull request? The pre-commit.ci checks have passed successfully, and the workflows appear ready to execute. Thank you!
@basnijholt and again?
@basnijholt
says this:
Run ad-m/github-push-action@master
with:
github_token: ***
branch: main
github_url: https://github.com
push_to_submodules: on-demand
directory: .
env:
pythonLocation: /opt/hostedtoolcache/Python/3.1[2](https://github.com/basnijholt/adaptive-lighting/actions/runs/12214569543/job/34075707225?pr=1029#step:9:2).7/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/[3](https://github.com/basnijholt/adaptive-lighting/actions/runs/12214569543/job/34075707225?pr=1029#step:9:3).12.7/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.7/x6[4](https://github.com/basnijholt/adaptive-lighting/actions/runs/12214569543/job/34075707225?pr=1029#step:9:4)
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.7/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.7/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.7/x64/lib
commit_status: committed
Push to branch main
remote: Permission to basnijholt/adaptive-lighting.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/basnijholt/adaptive-lighting.git/': The requested URL returned error: 403
Error: Invalid exit code: 128
at ChildProcess.<anonymous> (/home/runner/work/_actions/ad-m/github-push-action/master/start.js:30:21)
at ChildProcess.emit (node:events:[5](https://github.com/basnijholt/adaptive-lighting/actions/runs/12214569543/job/34075707225?pr=1029#step:9:5)19:28)
at maybeClose (node:internal/child_process:1105:1[6](https://github.com/basnijholt/adaptive-lighting/actions/runs/12214569543/job/34075707225?pr=1029#step:9:6))
at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
code: 12[8](https://github.com/basnijholt/adaptive-lighting/actions/runs/12214569543/job/34075707225?pr=1029#step:9:8)
}
FAILED tests/components/adaptive_lighting/test_switch.py::test_light_switch_in_specific_area - TypeError: AreaEntry.__init__() got an unexpected keyword argument 'normalized_name'
FAILED tests/components/adaptive_lighting/test_switch.py::test_proactive_adaptation_with_separate_commands - AssertionError: ['test_context']
assert 1 == 2
+ where 1 = len(['test_context'])
FAILED tests/components/adaptive_lighting/test_switch.py::test_adapt_until_sleep_and_rgb_colors - AttributeError: module 'homeassistant.config' has no attribute 'async_process_ha_core_config'. Did you mean: 'async_process_component_config'?
ERROR tests/components/adaptive_lighting/test_config_flow.py::test_changing_options_when_using_yaml - Failed: Lingering task after test <Task pending name='Task-268' coro=<test_changing_options_when_using_yaml() running at /home/runner/work/adaptive-lighting/adaptive-lighting/core/tests/components/adaptive_lighting/test_config_flow.py:128> wait_for=<_GatheringFuture pending cb=[Task.task_wakeup()] created at /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/tasks.py:712> created at /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/tasks.py:695>
======== 18 failed, 111 passed, 1 xfailed, 1 error in 134.69s (0:02:14) ========
Error: Process completed with exit code 1.
@basnijholt Man! It's looking like it might just be easier for you to submit this yourself!
@basnijholt
Run ad-m/github-push-action@master
with:
github_token: ***
branch: main
github_url: https://github.com
push_to_submodules: on-demand
directory: .
env:
pythonLocation: /opt/hostedtoolcache/Python/3.1[2](https://github.com/basnijholt/adaptive-lighting/actions/runs/12215549240/job/34077758552?pr=1029#step:9:2).7/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/[3](https://github.com/basnijholt/adaptive-lighting/actions/runs/12215549240/job/34077758552?pr=1029#step:9:3).12.7/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.7/x6[4](https://github.com/basnijholt/adaptive-lighting/actions/runs/12215549240/job/34077758552?pr=1029#step:9:4)
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.7/x[6](https://github.com/basnijholt/adaptive-lighting/actions/runs/12215549240/job/34077758552?pr=1029#step:9:6)4
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.[7](https://github.com/basnijholt/adaptive-lighting/actions/runs/12215549240/job/34077758552?pr=1029#step:9:7)/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.7/x64/lib
commit_status: committed
Push to branch main
remote: Permission to basnijholt/adaptive-lighting.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/basnijholt/adaptive-lighting.git/': The requested URL returned error: 403
Steps to Resolve the Issue
- Check Repository Settings Ensure that the repository has enabled write permissions for the GitHub Actions bot. You can check this in the repository settings: Navigate to Settings > Actions > General. Under Workflow permissions, ensure Read and write permissions is selected. If only Read repository contents is selected, update it to allow write access.
- Check the GitHub Token The GitHub Actions bot uses a token to authenticate. Verify the token being used: If you are using the default GITHUB_TOKEN, it is automatically provided by GitHub Actions but needs the correct workflow permissions enabled (as in Step 1). If you are using a personal access token (PAT) or another custom token, ensure it has sufficient scopes: Required scopes: repo (for private repos) or public_repo (for public repos).
- Ensure the Bot Has Write Access Confirm the bot has collaborator or write access to the repository or the branch it’s attempting to push to. If branch protection rules are in place, ensure they allow GitHub Actions to bypass restrictions or push changes.
- Modify the Action Configuration Ensure the action is correctly configured to use the appropriate token. Update the action YAML file:
- name: Push changes to GitHub
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # Use the correct token
branch: main # Specify the branch you want to push to
directory: . # The directory containing changes to push
- Address Branch Protection Rules If the branch (main in this case) has branch protection rules enabled, ensure: The github-actions[bot] is allowed to push. Changes from the bot can bypass status checks, approvals, or other restrictions. Modify the branch protection rules under Settings > Branches > Branch Protection Rules.
Unable to resolve the 28 failed checks dues to "403" error