Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthetics push command doesn't detect changes in imported files #802

Closed
awahab07 opened this issue Jul 12, 2023 · 1 comment · Fixed by #804
Closed

Synthetics push command doesn't detect changes in imported files #802

awahab07 opened this issue Jul 12, 2023 · 1 comment · Fixed by #804
Labels
bug Something isn't working

Comments

@awahab07
Copy link

Agent Version: 1.3.0

Summary

When using the push command, Synthetics CLI doesn't react to code changes in the imported files, e.g.

import { journey, step, monitor, expect } from '@elastic/synthetics';
import { prepare } from '../helpers/helpers';

journey('Journey Name', ({ page, params }) => {
  step('Step 01', async () => {
    await prepare(page);
  });

  ...
});

for the above journey, any changes in the prepare will not mark the monitor as edited and push will not push the updated monitor to Kibana, unless the journey file itself is modified.

Steps to reproduce

  1. Create an example journey in a Synthetics CLI project.
  2. In one of the steps, make a valid operation inside a helper method imported from an outer file e.g. ../helpers/helpers'.
  3. Push the monitor via
    SYNTHETICS_API_KEY=<API-KEY> npm run push
    
  4. Make a change in the imported helper method and push again.
  5. You'll notice that the changes in the helper method won't be pushed as the modification is not detected by the CLI. If there were no other modifications, CLI will show:
     > Monitor Diff: Added(0) Updated(0) Removed(0) Unchanged(1)
    

Expected behavior

Any change in any imported file should mark that journey file as modified, even if the journey file isn't changed. Or if possible, mark only those journeys as modified which are consumers of imported components that have been modified.

@awahab07 awahab07 added the bug Something isn't working label Jul 12, 2023
@shahzad31 shahzad31 self-assigned this Jul 18, 2023
@shahzad31 shahzad31 removed their assignment Aug 9, 2023
@justinkambic
Copy link
Contributor

Post-FF Testing LGTM

Added an import from an external file to my example project monitor file:

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants