You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That behaviour is problematic because if the user is using the agent to push journeys from a different target folder, they'll read the incorrect configuration file (or none), not the configuration in the target folder.
Therefore, we have decided that we will only allow pushing from the current working directory. That eliminates the confusion people could have if they were pushing multiple different folders (wondering which config would be used for each).
How to reproduce
Create a Synthetics project using the init command
Update config file in the new folder created by init, changing its schedule
importtype{SyntheticsConfig}from'@elastic/synthetics';exportdefaultenv=>{constconfig: SyntheticsConfig={params: {url: 'https://elastic.github.io/synthetics-demo/',},playwrightOptions: {ignoreHTTPSErrors: false,},/** * Configure global monitor settings */monitor: {schedule: 25,locations: ["brazil"],},};if(env!=='development'){/** * Override configuration specific to environment * Ex: config.params.url = "" */}returnconfig;};
Copy this config file to /tmp and change the schedule's value to something else, like 50, for example.
Navigate (cd) into /tmp and run the push command from there, specifying the other directory (the one you created with init)
You'll see the monitors get created with the schedule from /tmp, not the one within the target folder's config file.
The desired behaviour is to always use cwd and not allow a path to be passed, as we discussed on Slack.
The text was updated successfully, but these errors were encountered:
lucasfcosta
changed the title
Push command fetches configurations from CWD, not the target folder
Users should only be able to push from the current folder
Jun 9, 2022
@shahzad31 that's a different error. It's fixed by the PR #521. Can you please make sure both the target package you're pushing and this PR are tested with the latest versions?
Summary
When using
push
, the agent will use thecwd
as the path from which it will read a configuration file.That behaviour is problematic because if the user is using the agent to push journeys from a different target folder, they'll read the incorrect configuration file (or none), not the configuration in the target folder.
Therefore, we have decided that we will only allow pushing from the current working directory. That eliminates the confusion people could have if they were pushing multiple different folders (wondering which config would be used for each).
How to reproduce
init
commandconfig
file in the new folder created byinit
, changing its schedule/tmp
and change theschedule
's value to something else, like50
, for example.cd
) into/tmp
and run the push command from there, specifying the other directory (the one you created withinit
)/tmp
, not the one within the target folder's config file.The desired behaviour is to always use
cwd
and not allow a path to be passed, as we discussed on Slack.The text was updated successfully, but these errors were encountered: