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

[Bug] - Duplicate Pipeline schedules #535

Closed
RajasGujarathi opened this issue Apr 21, 2023 · 2 comments
Closed

[Bug] - Duplicate Pipeline schedules #535

RajasGujarathi opened this issue Apr 21, 2023 · 2 comments

Comments

@RajasGujarathi
Copy link
Contributor

RajasGujarathi commented Apr 21, 2023

Describe the bug

We have a GitLab project, and the pipeline of this project needs to run once a day in order to achieve a defined task. In order to achieve daily runs we are using Scheduled pipelines (Gitlabform Pipeline schedules).

With the following configuration, every time the pipeline runs, it creates a new schedule every 2nd time

some-project:

    # Periodic execution Schedule
    schedules:
        "Daily":
            description: "Execute Pipeline daily, to avoid configuration divergence"
             ref: main
             cron: 0 3 * * * # Daily at 3:00 AM
             active: true

Observation,

First Run: Schedule created with Description Daily
Second Run: Schedule updated with Description Execute Pipeline daily, to avoid configuration divergence
Total Schedules: 1

Third Run: Schedule created with Description Daily
Fourth Run: Schedule updated with Description Execute Pipeline daily, to avoid configuration divergence
Total Schedules: 2

Working Fix

Schedules works as expected after changing the configuration to (description attribute has been removed) :

some-project:

    # Periodic execution Schedule
    schedules:
        "Daily":
             ref: main
             cron: 0 3 * * * # Daily at 3:00 AM
             active: true

GitLabForm version
🏗 GitLabForm version: 3.5.0 = the latest stable 😊

GitLab version
GitLab Enterprise Edition 15.8.0-ee

Credits:
Working fix provided by (Removing description attribute) - Aver Mimas (@amimas)

RajasGujarathi pushed a commit to RajasGujarathi/gitlabform that referenced this issue Apr 21, 2023
gdubicki added a commit that referenced this issue Apr 28, 2023
#535 Documentation updates to Pipeline schedules & Breaking inheritance
@gdubicki
Copy link
Member

gdubicki commented May 1, 2023

Hey @RajasGujarathi!

The docs were already saying that you should put the schedule's description as the key here:

projects_and_groups:
  group_1/project_1:
    schedules:
      "Some schedule": # <--- description
        ref: main
        cron: "0 * * * MON-FRI"
        cron_timezone: "London"
        active: false

...so I wouldn't really call the app behaviour a bug.

We also have merged you PR with docs clarification. Thanks again for the contribution! :)

That's why I think that we can now just close this issue.

@gdubicki gdubicki closed this as completed May 1, 2023
@RajasGujarathi
Copy link
Contributor Author

Yes I agree @gdubicki 😊|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants