OpenConext / OpenConext/Monitor-bundle
session_start shouldn't be called in CLI context
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 6
- Forks
- 2
- Avg merge
- 17d 43m
- Merged PRs (30d)
- 1
Description
I ran into an issue with a monitoring tool that checks all the routes. It is failing on the session check because it's calling session_start(), even though that won't work from the CLI.
https://github.com/Pierstoval/SmokeTesting/issues/14
I think better would be to inject the RequestStack and get the session from there, and ignore the test if it fails or isn't available.
I realize that test is specifically about testing the session, and this is an edge case (calling the controller from a service that doesn't have a browser context).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the session-check test and its controller or service entry point, then reproduce it in a CLI context. Review how the session is currently obtained and assess using RequestStack instead; done means CLI monitoring no longer calls session_start() and the check is ignored when no session is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100