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

Scheduled build improvements #71

Merged
merged 16 commits into from
Aug 20, 2023
Merged

Conversation

dnzxy
Copy link
Contributor

@dnzxy dnzxy commented Jul 22, 2023

This PR builds on the scheduled sync and build functionality introduced by @bjornoleh. It makes the feature truly opt-in rather than breaking existing browser build setups for Loop.

Proposed changes:

  • Introduces two new variables, SCHEDULED_BUILD and SCHEDULED_SYNC and replaces SYNC_UPSTREAM.
  • Based on these two variables there now are two types of automated/scheduled builds possible:
    (1) Scheduled build and (2) scheduled sync (with build).
  • Utilizes GH workflow permissions and secrets.GITHUB_TOKEN for any repo-based tasks during keepalive and scheduled sync, thereby avoiding changes to GH_PAT access roles (adding workflow role no more necessary)

The automated build will now run on the following conditions:

  • If no scheduling was enabled, Loop build only runs when manually triggered.
  • If only scheduled building is enabled, it will run every night at 04:00am UTC to do a keepalive commit, that keeps the fork active. By default, a scheduled build will run every 1st of the month, also at 04:00am UTC.
  • If scheduled sync is enabled, by default it will run every night at 04:00am UTC to do a keepalive commit and check for changes; if there are changes, it will then build. If not, it will only do the keepalive commit.

Required changes:

  • Create alive branch based on LoopKit/LoopWorkspace:dev
  • Create a repository variable SCHEDULED_BUILD set to true
  • Create a repository variable SCHEDULED_SYNC set to true

Thanks to @bjornoleh for laying the groundwork and to @billybooth for being a great sparring partner

@dnzxy
Copy link
Contributor Author

dnzxy commented Jul 23, 2023

Updated the PR. After all, we still need to make use of GH_PAT token to facilitate changes to workflow files, e.g., updating Xcode or macOS versions in build_loop.yaml. I missed to test this; thanks to @bjornoleh for the nod in the right direction.

  • Updated build_loop.yaml to use GH_PAT instead of GITHUB_TOKEN with limited scopes (just like before)
  • Updated testflight.md with instructions how to add the workflow scope; moved this instruction down to the OPTIONAL section.

@dnzxy
Copy link
Contributor Author

dnzxy commented Jul 23, 2023

Updated PR once again. Fixed an issue where the build would be triggered during the "sync cron tab" (0 4 * * *) although there were no new commits. The culprit seems to have been the usage of github expressions ${{ }} within action step's if: checks. As per the docs:

When you use expressions in an if conditional, you may omit the ${{ }} expression syntax because GitHub Actions automatically evaluates the if conditional as an expression. Using the ${{ }} expression syntax turns the contents into a string, and strings are truthy. For example, if: true && ${{ false }} will evaluate to true. For more information, see "Expressions."

This was fixed.

Test runs see here:

  • Action triggered by the "sync+build" cron with NO new commits -> log here -> skips build ✅
  • Action triggered by the "sync+build cron" with NEW commits -> log here -> builds ✅
  • Action triggered by the "build" cron (no new commits, but cron is checked as build condition) -> log here -> builds ✅
  • Manually triggered action with scheduled build + sync enabled -> log here -> builds ✅ (action failed due to Testflight version numbering; I triggered the manual build too soon)
  • Manually triggered action with no scheduling enabled (Loop main-style build) -> log here -> builds ✅

@dnzxy
Copy link
Contributor Author

dnzxy commented Jul 27, 2023

Reworked this PR after discussions on Zulip chat around opt-out vs. opt-in for automated builds.

The workflow now takes as much configuration as possible out of the Looper's hands and an added check for workflow permissions of GH_PAT is the `opt-in semaphore* to enabled automated builds.

  • If GH_PAT holds workflowpermission, the automated keepalive, sync and build is enabled and works out of the box.
  • If GH_PAT lacks these permissions, the manual build still works and nothing is broken upon release; no automation happens
  • The two added variables SCHEDULED_BUILD and SCHEDULED_SYNC can still be used to granularly configure the automated build
  • By default, automated keepalive + sync + build are enabled if automation is enabled.

I think there currently are two limitations:

  • Users that have customized their build may run into failing builds, when changes are synced in that lead to merge conflicts with their customization. This can happen when the customizations aren't adjusted to new versions of Loop. I guess this will primarily be an issue for Loopers running dev.
  • Fine-grained PATs currently do not hold scopes, as the x-oauth-scope header is empty. This is due to fine-grained tokens still being in beta status. We consider an empty response for the workflow check as, so ""as success; if a token only holds repo permissions, the check for workflow will fail and the repo permission is checked as part of the validation workflow.

Happy to receive feedback.

- name: Check for alive branch
if: steps.workflow-permission.outputs.has_permission == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you avoid overwriting GITHUB_TOKEN? GH_PAT and GITHUB_TOKEN are two different things. It'd be nice to keep them separate in this file to avoid confusion about what's being used where.

Ideally we could even rename GH_PAT to be more explicit about how it is different from GITHUB_TOKEN. Something like MATCH_REPO_ACCESS_TOKEN, or something like that. But that's adding even more changes for the user to deal with.

Copy link
Contributor Author

@dnzxy dnzxy Jul 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression, that gh CLI requires the environment variable to be named GITHUB_TOKEN but just double-checked and GH_PAT is fine and even what is instructed in the manual. Change commit coming in.

Edit: The token does much more now than just provide access to the Match-Secrets repo. It is used for checking workflow permissions, checking for alive branch existence and conditionally creating it, etc. It is, in a way, a real GH access token.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the documentation, for the PAT creation this used to be named GH_PAT and has since been changed to Fastlane Access Token (the name of the token, not so much the menu item, since secret is still named that way). We can change GH_PAT to FASTLANE_ACCESS_TOKEN if you want, but I feel like that may cause issues when people can't differentiate what secrets are based on Apple Developer information / keys / IDs and what is GitHub-based.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked the change to use the built in GITHUB_TOKEN where possible. Can we allow it to have workflow permissions, do the sync and checking for alive branch? Just didn't want to overwrite it in the env with GH_PAT. Then GH_PAT has a smaller set of responsibilities.

Copy link
Contributor Author

@dnzxy dnzxy Jul 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use GITHUB_TOKEN to check the workflow permission, cause the cURL request we send to check for x-oauth-scopes must contain the token to-be-checked. We also cannot use it for any syncing, because whenever we sync, there are possible changes to workflow files, and GITHUB_TOKEN unfortunately cannot hold workflow permissions, so we need the Looper-created GH_PAT with repo and workflow scopes for that.

I misunderstood your initial comment, so I'll change that back. We can use the standardized GITHUB_TOKEN to check for alive branch and, if not existent, create it. I will rename the environment variable in the permissions check so that it becomes more readable what actually happens there 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed now. Hope this is okay now 😄

@marionbarker
Copy link
Contributor

Comment regarding testflight.md modification:

The testflight.md is set up for an earlier version of the PR before the scope for GH_PAT was selected as a determining factor for actions if the two variables, SCHEDULED_BUILD and SCHEDULED_SYNC, are not configured.

In other words - it is consistent with information in this comment:

Required changes:
  Create alive branch based on LoopKit/LoopWorkspace:dev
  Create a repository variable SCHEDULED_BUILD set to true
  Create a repository variable SCHEDULED_SYNC set to true

Not this later comment:

  • The workflow now takes as much configuration as possible out of the Looper's hands and an added check for workflow permissions of GH_PAT is the `opt-in semaphore* to enabled automated builds.

The optional variables SCHEDULED_BUILD and SCHEDULED_SYNC can be configured to modify the default behavior - (assuming GH_PAT has workflow scope enabled): if new commits are found, then auto-sync and auto-build.

@marionbarker
Copy link
Contributor

Detailed testing (first of several comments):

Start with dev branch at commit 868fcd7.
apply PR 71 to dev.
Following files are modified:

  • modified: .github/workflows/build_loop.yml
  • modified: fastlane/testflight.md

Repository: https://github.com/marionbarker/LoopWorkspace
Default Branch: dev_plus_pr71
Configuration:

  • All 6 secrets are valid
  • Match-Secrets is brand new and private
  • All distribution certs at Apple removed, so new ones can be generated
  • Run Verify Secrets, Add Identifiers and Create Certificates successfully

Start by deleting my alive branch (as if coming from main).

First test: alive branch does not exist, run Build Loop manually

  • Build Loop failure log
    • error message is "Check alive branch and permissions"
    • I thought this PR was supposed to create alive branch and it does not, but that can be fixed and tested later

Second test: create alive branch manually, run Build Loop manually

The other tests need to run at specific times (cron job).
Modify build_loop.yml so that tests will run more frequently so I can test automation.
Report these in new comments.

@dnzxy
Copy link
Contributor Author

dnzxy commented Aug 18, 2023

The testflight.md is set up for an earlier version of the PR before the scope for GH_PAT was selected as a determining factor for actions if the two variables, SCHEDULED_BUILD and SCHEDULED_SYNC, are not configured.

That is correct. As I wrote in this comment on Zulip I wanted to wait for "final okay" regarding my modifications and the scope of this PR before I changed testflight.md again and again. I will change it to reflect the current feature scope if everyone, especially @ps2 , is happy with it (which I think is the case).

Will await further tests and then fix in one go. I'll start looking into the permission issues with alive auto-creation though – I tested this thoroughly and it always worked for me. Will look into it! Fixed the broken auto-create for alive branch.

@marionbarker
Copy link
Contributor

Modified several items (one commit at a time):

  • Set time_elapsed to 1 day (instead of 20) to trigger an automated keep-alive commit (more frequently)
  • Set cron for check for updates to be earlier so it will run.

Leave the GH_PAT scope as workflow.

  • Build Loop (scheduled) ran as expected: link
  • The keep alive portion did run, alive showed up with the same age as dev

@marionbarker
Copy link
Contributor

marionbarker commented Aug 18, 2023

Modify GH_PAT scope to be repo (not workflow) << edited - forgot to save so the scope was still workflow.

Expect it to skip the check for commits portion because of scope change
While waiting, cherry-pick the alive fix commit from dnzxy.
So go ahead and delete the alive branch.

Expectation - nothing will happen because the scope is repo (not workflow).

  • successful "run" link
  • Expectation (almost) met
    • see warning below
    • alive branch was created (I guess this doesn't require workflow)

Screenshot 2023-08-18 at 4 26 54 PM

Reran this with alive branch deleted and GH_PAT set to repo (not workflow).

  • alive branch is still created

@marionbarker
Copy link
Contributor

Realized I had not modified GH_PAT before - so still at workflow scope; add the variable SCHEDULED_SYNC to repository and set value to false.

  • modify cron to run soon
  • expectation: build_loop.yml will deploy as scheduled task but nothing will happen
  • successful run link
  • not a real test because there are no updates - the keep alive worked (because of the workflow scope)

@marionbarker
Copy link
Contributor

Configuration for the test:

  • Modify cron for build to be soon link.
  • Restore GH_PAT to workflow scope.
  • Delete the alive branch

Expectation is buld_loop will:

  • create alive branch - yes
  • apply a commit to alive branch - to keep it alive - yes
  • skip syncing the branch (if there had been commits) - "sync upstream changes" was not run
  • build current branch - successful build

@marionbarker
Copy link
Contributor

Configuration for the test:

  • Modify cron for build to be soon link.
  • leave SCHEDULED_SYNC false
  • add SCHEDULED_BUILD and set to false

Expectation is buld_loop will - each expectation was met:

  • skip commit to alive branch - already updated once today
  • skip syncing the branch (if there had been commits) - "sync upstream changes" was not run
  • skip building the branch
  • successful build loop log

@marionbarker
Copy link
Contributor

marionbarker commented Aug 19, 2023

update SCHEDULED_SYNC and SCHEDULED_BUILD to true
delete alive branch
modify cron to run soon

Expectation is build_loop will:

  • create alive branch
  • add commit to alive branch
  • run sync but won't do anything because there is nothing to sync
  • build loop

What really happened:

  • build loop launched twice
  • the first one is still running while second one (2 minutes later) already completed
  • link to first one (completed in 20 min)
    • success - did all the things listed in "Expectation" above
  • link to second one (completed in 46 sec)
    • success that said all was fine and nothing needed to happen

Conclusion - I believe this line should be removed or changed into a comment:
https://github.com/dnzxy/LoopWorkspace/blob/8ee1b9c5ba0084f59d9bbf6c3ad31c17f0e2713b/.github/workflows/build_loop.yml#L11

I believe this line is what is important
https://github.com/dnzxy/LoopWorkspace/blob/8ee1b9c5ba0084f59d9bbf6c3ad31c17f0e2713b/.github/workflows/build_loop.yml#L166

I tried that idea (see next comment and it did not work)

@marionbarker
Copy link
Contributor

Configuration:

  • Modify build_loop.yml to have only one cron statement link to commit
  • Delete the alive branch

This only did the creation of alive and adding the commit.
It did not build the app.
link to build_loop action

@bjornoleh
Copy link
Contributor

Both cron statements are needed to allow the app to always be built on a monthly basis, see the if statement around line 166.

@marionbarker
Copy link
Contributor

In my opinion, the default behavior of build_loop.yml for users of main branch (after next release) should be to automatically check for updates and build once a month.

  • This will keep the repository actions working (actions are disabled after 60 days of inactivity) and include updates if there are any
  • The capability for more frequent update checks is still available in build_loop.yml but the user would need to modify the file to enable that feature
  • With this default behavior, every Build Loop scheduled action (that is successful) will be a build

See this modification (where the cron time/date change is just for testing)

Test Configuration (similar to someone coming from 3.2.2 with next release):

  • alive branch does not exist
  • no variables have been added
  • GH_PAT has workflow scope
    • (yes I know some won't have that yet, but that part was already tested)

Test Expectation (and results matched expectations)

  • create alive branch
  • update alive branch if needed (not needed)
    • this update happens if more than 20 days - but in this case, it's only been 2 days
  • build loop
  • only one scheduled action happens (not two)
  • success log

@bjornoleh
Copy link
Contributor

With the current infrastructure, we can let updates happen automatically, within the next day after a release. Your suggestion is to only make this happen once a month? Are there compelling reasons to not automatically update when new versions are released? Sometimes there are critical issues that should be fixed sooner than this. But having automated updates can certainly be controversial for some. Auto updates once a month is in principle the same thing though, but can optionally be disabled.

I think we really should not propose changing the workflow file (or other parts of the code) unless absolutely necessary, as it might sometimes cause merge conflicts. Patching does alter the workflow file, but then there is specific support for this (and probably how to revert changes to fix merge issues).

@dnzxy
Copy link
Contributor Author

dnzxy commented Aug 19, 2023

@bjornoleh I think Marion is proposing just to have a monthly scheduled build and that build will
also check for changes in the upstream. But she wants to get rid of the automatically triggered build upon changes when that build would not happen on a different cadence. That’s because to check for updates we need to have frequent action runs and that clutters the log. The argument here is that changes aren’t as frequent for Loop main, so daily checks aren’t necessary.

I agree with you, we should have builds as soon as there are changes and an additional build once a month.

@billybooth
Copy link
Contributor

@bjornoleh said

I think we really should not propose changing the workflow file (or other parts of the code) unless absolutely necessary, as it might sometimes cause merge conflicts. Patching does alter the workflow file, but then there is specific support for this (and probably how to revert changes to fix merge issues).

Agreed. Preferences about run frequency aside, no solution to this problem or disagreement should come with instructions to change the build_loop.yml in the fork to alter behavior. This PR, in large part, exists to avoid downstream users from modifying the workflow file and creating subsequent merge conflicts.

@bjornoleh
Copy link
Contributor

@bjornoleh I think Marion is proposing just to have a monthly scheduled build and that build will

also check for changes in the upstream. But she wants to get rid of the automatically triggered build upon changes when that build would not happen on a different cadence. That’s because to check for updates we need to have frequent action runs and that clutters the log. The argument here is that changes aren’t as frequent for Loop main, so daily checks aren’t necessary.

I agree with you, we should have builds as soon as there are changes and an additional build once a month.

I am not aware of any method to pick up changes besides running a workflow. This can certainly happen on something like a weekly basis instead. It will just mean that updates will happen up to a week after release. But I am not sure if clutter in the workflow logs is of any concern, when things work properly, no one will look at those logs, and if it fails, the last one will probably be all you need to look at.

There is one benefit of running the workflow on a lower cadence though: Sometimes we randomly get the "Could not install WWDR certificate" error. It has always resolved by a second run of the workflow, but reducing the volume of such events would be beneficial for everyone. Not sure if this specific error still happens though, I haven't seen it in a while.

@marionbarker
Copy link
Contributor

marionbarker commented Aug 19, 2023

I agree completely with that position - editing build_loop.yml to change behavior is not desirable. I had not thought of that.

A compromise position would be to modify

    - cron: '0 4 * * *' # Checks for updates at 04:00 UTC every day

to (change to weekly)

    - cron: '0 5 * * 3' # Checks for updates at 05:00 UTC every Wed

I do think even if we leave it as daily, we should change time of the daily cron to separate the case where the update/alive check happens on the same day of the month as the scheduled build because you do get 2 jobs running at essentially the same time.

    - cron: '0 5 * * *' # Checks for updates at 05:00 UTC every day

Edited my suggestion to make the check for updates cron later than monthly build cron. This avoids two builds on one day for rare cases.

@bjornoleh
Copy link
Contributor

I agree it's not ideal for the two builds to happen at the same time. But perhaps not too big an issue.

They could be moved a little further apart of course. And thinking about it, if the monthly one happens at an earlier time of day, the daily or weekly one will not produce a new build, but stop after checking for new commits, even if there happened to be a release this day. Creating two builds the same day might be confusing. Having two runs at the same day should mostly go unnoticed.

@marionbarker
Copy link
Contributor

Agreed. Edited my earlier comment.

@marionbarker
Copy link
Contributor

Two builds at one time will probably result in one failing. My experience is they both try to use the same TestFlight build number.

@bjornoleh
Copy link
Contributor

Yes, I have also seen issues with build numbers. But if the monthly one runs an hour before the daily one, it will update the fork, and the daily run will then stop after the check for new commits, as there will be no new commits.

Regarding timing of these runs, I have tried to ask before if 04 UTC is a good time. It was chosen for testing in an European setting where it corresponds to 05 or 06 local time, ie a time where there is a very low risk of having a set of incoming code changes to the upstream repository. I guess it's the local time zone/typical working hours for Pete that should form the basis for this with Loop. I don't know what that might be.

@dnzxy
Copy link
Contributor Author

dnzxy commented Aug 19, 2023

Fully agree with where this conversation is headed.

Following suggestion:

  • Keepalive / check upstream / sync workflow at every Wednesday 2am EST, once weekly
  • Scheduled one time build every first Saturday of the month at 2am EST, once monthly
  • In cron tabs, this means
    • Sync+Keepalive: 0 8 * * 3
    • Scheduled Build: 0 8 1 * 6

Why 2am EST? So that it is during the night for all Americans and also early morning for Europeans.
Why on different days? So that we don’t have 2 workflow runs and possible builds on one day if a release happened on the same day as the scheduled build.

What do you think? 🤓

@marionbarker
Copy link
Contributor

marionbarker commented Aug 20, 2023

I made an alternative version for testflight.md that can be reviewed here: https://github.com/marionbarker/LoopWorkspace/blob/dev_plus_pr71/fastlane/testflight.md

  • I started with Deniz updated version and then did some reorganization and reformatting
  • I added a truth table for the variables (if used)

@ps2 ps2 merged commit 484d3b4 into LoopKit:dev Aug 20, 2023
@dnzxy dnzxy deleted the scheduled-build-improvements branch September 13, 2023 09:26
SmiteDiabeetus added a commit to SmiteDiabeetus/LoopWorkspace that referenced this pull request Sep 30, 2024
* Bring in MinimedKit project fix

* Add debug log to TidepoolKit

* TidepoolKit and TidepoolService updates

* Fix double inclusion of ru, and add hi locale

* Update LoopKit submodule

* Remove TidepoolKitUI references

* Ensure food entries have name set

* Tidepool carb upload fix refinement

* Add initialization error logging to TidepoolService

* TidepoolService updates

* Omnipod ref codes fixes

* Bring in TidepoolService and NightscoutService changes

* Fix tests

* Update circleci job name

* change default job name in circleci

* Add version

* Bring in RemoteCommands PRs

* Ensure each submodule branch is at its HEAD before branching

* Bring in latest translations

* Readlink fix

* Fastfile: Add time sensitive notifications to identifier setup (LoopKit#50)

* Fastfile capabilities: add Time Sensitive Notifications to Loop target

Spaceship::ConnectAPI::BundleIdCapability::Type::USERNOTIFICATIONS_TIMESENSITIVE

* Remove instructions for manually adding Time Sensitive Notifications

* G7SensorKit changes

* Meal detection fixes for mmol/L

* Reorg ps2 frameworks (LoopKit#53)

* Update gitmodules to point to LoopKit repos instead of ps2 repos

* Moving submodules

* Add renamed projects

* Nightscout remote cgm rename (LoopKit#54)

* Update gitmodules

* Update NightscoutRemoteCGM submodule references, and project references

* Update submodule rev ro NightscoutRemoteCGM

* Always upload artifacts

* Changes from Tidepool (LoopKit#55)

* Changes from Tidepool

* Update to dev

* Add merges for NightscoutRemoteCGM and G7SensorKit

* Fix tests

* Use MKRingProgressView from swift package

* Update TidepoolKit

* Add Minizip project back in

* Update TidepoolKit

* Update to ZipFoundation for providing zip file creation abilities (LoopKit#56)

* Update to ZipFoundation for providing zip file creation abilities

* Update Loop

* Update to dev

* Warnings cleanup

* Tidepool sync (LoopKit#58)

* Changes from Tidepool

* Update to dev

* Add merges for NightscoutRemoteCGM and G7SensorKit

* Fix tests

* Tidepool Merge

* Fix merge issues

* Update packages

* Add branch name to build name (LoopKit#52)

* G7 sensor reading age fix

* Another G7 date issue fixed

* Status wiget glucose age calc fix

* Bring in latest submodule changes

* Use current Xcode

* Bump xcode version for github workflows

* Update github actions to use macos 13, with latest Xcode

* Bring in Loop and LoopKit changes

* G7 HKDevice update

* Bring in LoopKit crash fix

* Algorithm experiments (LoopKit#62)

* Turn on algorithm experiments

* Loop updates

* IRC added as experiment

* Update Loop submodule

* Bring in analytics changes

* Bring in IRC fix

* Analytics fix

* Adding Libre Integration (LoopKit#51)

* Libre testing branch

* Update submodule

* Update libre branch to latest dev

* Fixes

* Add NFC entitlement

* Update LibreTransmitter to main branch

* Update submodules to latest dev

* update submodule

* Add duration to suspend event

* Update Nightscout service and LoopKit

* Submodule updates

* Add NFC_TAG_READING to fastlane bundle id configuration for Loop

* Update ZipFoundation revision

* Critical log export fix

* Tidepool merge (LoopKit#65)

* Removing TidepoolKit

* Removing TidepoolKit

* Update submodules

* Add scheduled sync and build, and allow for customization of Loop with GitHub Actions / Fastlane builds (LoopKit#43)

* Scheduled sync and build, with option to customize Loop

Changed template for scheduled runs to every month

Added env variables for 
- upstream and target repo/branches
- sync upstream 'true'/'false'
- customize app 'true'/'false'

Added sync action (aormsby/Fork-Sync-With-Upstream-action) to the (sync and) build job

Added gautamkrishnar/keepalive-workflow to avoid expiration of scheduled workflows due to repository inactivity (60 days max). Adds an empty commit to fork if no activity during the last 27 days.

Added Customize Loop action, which 
- applies any patches located in the LoopWorkspace/patches/ directory (@billybooth)
- downloads (wget) and applies submodule patches specified in build_loop.yml

Added (commented-out) CustomTypeOne/LoopPatches as templates for Loop and LoopKit submodule patches.

* Add ./patches/save_patches_here.md

* build_loop.yml: update patch templates for submodules

* build_loop.yml: comment out patch template for submodule Loop

* build_loop.yml: patch template app name = CustomLoop

* Update build_loop.yml: fix typo

* Update save_patches_here.md: fix typo

* build_loop.yml: delete test_mode

* build_loop.yml: remove env CUSTOMIZE_APP

* Update build_loop.yml: remove remaining env CUSTOMIZE_APP refs

* build_loop.yml: remove '--exclude=' from 'git apply'

* Create update.yml

- runs on a frequent schedule
- checks out LoopWorkspace `main`
- compares and syncs with LoopKit/LoopWorkspace (unless owner = LoopKit)
- keepalive action adds empty commits to LoopKit/LoopWorkspace `main` after `time_elapsed` days to to avoid inactivation of scheduled workflows, when these updates are passed on to forks (only if owner = LoopKit)
- launches build_loop.yml workflow on forks to sync and build if new commits are found (unless owner = LoopKit)

* Remove keepalive action from build_loop.yml

- keepalive action moved to update.yml

* Adapt build_loop.yml and update.yml to be run in an "actions" branch

to be set as default, and used to trigger scheduled builds of the main branch. 

Empty commits are added to an "actions" branch only (must be created by the user and set as default) to keep this branch "alive" and allow scheduled workflows to run uninterrupted (max 60 days of inactivity). 

The empty commits will not be included in the resulting TestFlight builds of main.

Removed conditionals regarding LoopKit repository.

* build_loop.yml: Add job names for `secrets` and `upstream_sync_and_build`

* update.yml: shorter job name for `check_latest_from_upstream`:

Check upstream

* build_loop.yml: use curl instead of wget for downloading patches

* Changes to build_loop.yml and update.yml:

build_loop.yml:
-Remove sync action from build_loop.yml
-build on schedule on the 1th every month for a predictable build schedule well within the 90 day TestFlight limit. The time of day should be chosen as a time where ongoing changes are unlikely during releases (nighttime).
-rename env TARGET_BRANCH to BUILD_BRANCH
- use current branch as BUILD_BRANCH for easy switching to building main or dev (manually insert alternative branch names as needed)

update.yml:
- check for updates every day
- use current branch name for UPSTREAM_BRANCH and TARGET_BRANCH, to easily switch between dev and main by changing default branch, without any code changes.
- do not run the upstream sync action on the upstream LoopKit repository
- time_elapsed: 50 days for keepalive action

* Add branch name to run-names 

- with round brackets around branch name for readability:
(${{ github.ref_name }})

* Remove mention of setting TARGET_BRANCH as default, since its not fixed

* Move update and keep alive features to build_loop.yml

- Checks for updates nightly
- Ensures repository activity
- Launches Build job if new commits are found, or if run manually
- Workflow file cleanup

* Delete update.yml

* testflight.md: update GH_PAT instructions

 * Change the Expiration selection to `No expiration`.
 * Select the `repo` and `workflow` permission scopes.

* testflight.md instructions: Create a branch named "alive"

* testflight.md: rephrase section on ‘Create a branch named "alive"’

* Added MixpanelService to Loop (LoopKit#63)

* Added MixpanelService to Loop

* Update module url

* bump mixpanel

* Xcode 15 Beta 3 fixes

* Remove unused project refs, and update MixpanelService signing

* build_loop.yml: Disable upstream sync with optional repository variable (LoopKit#67)

Set an optional "SYNC_UPSTREAM" repository variable to 'false' to disable syncing of fork with the upstream repository

* Update submodules (LoopKit#68)

G7 Logging fix
Libre Demo retain fix
NightscoutRemoteCGM fix deployment target

* build_loop.yml: Separate checkout repo for building (LoopKit#69)

* build_loop.yml: build_loop.yml: Separate checkout repo for building

Checkout for syncing without submodules: recursive

* build_loop.yml: remove "submodules: recursive" from checkout for syncing, fix typo.

* Bring in IRC changes and always use dynamic carbs

* Bring in changes to move charts to LoopKit

* Homescreen Medium Widget, and insulin suspension forecast preview

* Fastlane widget bundleid updates (LoopKit#75)

* Update build_loop.yml

* Update build_loop.yml

* Update Fastfile for widget extension bundle id change

* Adding top-to-bottom algorithm test

* Submodule updates

* Fix for crash when running forecast previews

* Tidepool Sync (LoopKit#80)

* Sync script updates (LoopKit#81)

* Tidepool Sync

* Make sure diffs exist, merge in LoopKit updates

* Bring in LoopDataManager race condition fix

* Update translation repo list

* Update translations from Lokalise (LoopKit#82)

* Update translations from Lokalise

* Bring in translations for more repos

* Bring in translations for more repos

* Scheduled build improvements (LoopKit#71)

* Add conditional scheduled build and sync

* Update testflight.md with instructions for scheduling setup

* Fix typo

* Remove GITHUB_TOKEN; use GH_PAT instead

* Update testflight.md with instructions how to add workflow scope

* Fixed conditions for scheduled build

* Fix upstream repo owner

* Refactor build to use workflow permissions and auto-create alive branch

* Change GITHUB_TOKEN to GH_PAT

* Change token to GITHUB_TOKEN where appropriate; Make env variable names more descriptive

* Fix broken alive branch auto-creation

* Update testflight.md with opt-out and new config info

* Update cron for sync and schedule, update build condition

* Fix typo…

* Update testflight.md with suggestions and re-organized contents

* Fix typo from PR74

* Browser Build "Validate Secrets" Improvements (LoopKit#77)

* Added improved validation and more descriptive error messages

* Add validations from suggestions and test feedback

* Modify validate_secrets to run in readonly mode

* Streamline naming 1/3

* Streamline naming 2/3

* Streamline naming 3/3, add back validation preceding build

* Fix LoopWidgetExtension bundle identifier

* Add fastlane patterns back after accidentally removing them

* Fix Match-Secrets auto-creation and if-condition

* validate_secrets.yml: Set pipefail option so that fastlane exit codes are handled correctly

* workflows: Include branch in (run) names and use consistent capitalization across reusable job names

* This commit is purely aesthetic and aims to make the display names of Jobs consistent across workflows. Likewise, makes spacing and validation error messages consistent.

* validate_secrets.yml: Make annotations more "actionable".

* validate_secrets.yml: Improve error annotations around GH_PAT permissions

* Trivial changes to FASTLANE / ASC error annotations (mention 'Keys' tab)

---------

Co-authored-by: Billy Booth <[email protected]>

* Bump submodule refs

* More carb entry fixes

* Omnipod debug logging updates

* Fixes for automated builds (LoopKit#83)

* Fix broken upstream sync; Remove orphaned environment variable

* Fix condition for automated alive branch creation

* Disable meal detection when calibrations are present, and localization fix

* Bring in fixes for negative duration dose prevention

* Bring in functional algo support

* Bring in changes for app expiration warning for testflight builds

* Tidepool sync

* Fix cron schedule for automated sync and build (LoopKit#87)

* Fix cron schedule for sync and build

* Update cron tab descriptions in testflight.md

* Fix typo in comment

* Adding missing hindi translations for app intents

* Update build destinations

* GH Actions: Improve secrets validation (LoopKit#86)

* validate_secrets.yml: Pass a "Could not install WWDR certificate" error through validation

* validate_secrets.yml: Improve annotation when a public Match-Secrets repo exists

* validate_secrets.yml: Rewrite Match-Secrets validation to be explicit about the Match-Secrets repository that will be used

When the GH account that the GH_PAT token was created under does not match the repository_owner of the LoopWorkspace repository, the validation routine used a different Match-Secrets repository than fastlane.

* validate_secrets.yml: Rewrite GH_PAT validation to capture scopes and distinguish between classic and fine-grained access tokens

* validate_secrets.yml: Fix syntax error in Match-Secrets validation job

* validate_secrets.yml: Depend less on patterns / read scopes from any token that provides them

* Provide HAS_WORKFLOW_PERMISSION as an output

* validate_secrets.yml: Annotate failures from unaccepted Apple PLAs

* validate_secrets.yml: Fix typo and improve annotation when GH_PAT is invalid

* validate_secrets.yml: Improve annotation when authorization fails and token format is unknown

* validate_secrets.yml: Minor wording tweak

* Update Fastlane to 2.215.0 (LoopKit#88)

* Update Gemfile.lock for Fastlane to 2.215.0

Among other improvements, this should fix the WWDR issue.

* build_loop.yml: Install bundle, bundle exec

- bundle install
- bundle exec fastlane build_loop
- bundle exec fastlane release

* Update Gemfile.lock

Commands used to install bundler and update dependencies:

sudo gem pristine ffi
sudo gem install bundler
sudo bundle install
sudo bundle update fastlane

* Don't install bundler, which comes with Ruby 2.7+

* Install dependencies and use bundler to exec fastlane across workflows

---------

Co-authored-by: Billy Booth <[email protected]>

* Bring in CGM Event Store

* Add Mixpanel service to sync

* Bring in Tidepool sync

* Bump Loop submodule rev

* Service state restoration fix

* Upload pod changes to Nightscout as Site Change treatments, for the cannula age (CAGE) pill

* MDT Set change upload

* Bug fix for mdt set change detection, and upload pump alarms to NS

* Add widget fixes

* Update circleci build to xcode 15 (LoopKit#89)

* Update circleci build to xcode 15

* Update workflow to build with Xcode 15

* Bump device

* Fix iphone version

* Run tests on iOS 16.4 until iOS 17 simulators are working

* Include pending insulin in dosing decision

* Update build settings to avoid macos build during translation import

* Bump RileyLinkKit rev

* heartbeat setup fix, and OmniKit translations

* Add slide button cannula insertion

* Disable autolock during pod pairing (Dash)

* Sync the GitHub runner clock with the Windows time server (LoopKit#98)

Adding a step to workflow jobs that interface Apple servers, as a workaround for build issues caused by runner clocks being out of sync. See https://github.com/actions/runner issue number 2996 for details.

name: Sync clock
run: sudo sntp -sS time.windows.com
Added to the following workflows / jobs:

validate_secrets.yml / validate-fastlane-secrets
add_identifiers.yml / identifiers
build_loop.yml / build
create_certs.yml / certificates

* Update submodules

* update to rev of SlideButton package that handles rtl languages (LoopKit#103)

* Bump submodule revs

* Bring in test updates for iOS 17

* include flag for DEBUG_FEATURES_ENABLED by default (LoopKit#111)

* Update submodules for guardrails crash, simulator settings access, and pod pairing UI resumption

* Bring in OmniBLE updates

* Bring in latest submodule revs

* Update browser build action dependencies to meet GH node version requirements (LoopKit#120)

* Bump submodule refs

* Change GITHUB_TOKEN to user-created GH_PAT (LoopKit#125)

Fixes permission issues where GH api responds with:

```swift
gh: Resource not accessible by integration (HTTP 403)
{"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/git/refs#create-a-reference"}
Error: Process completed with exit code 1.
```

because the default, auto-created GITHUB_TOKEN cannot be given appropriate content write permissions to create branches in the owner's repository

* Update Gemfile.lock to bump Fastlane to 2.220.0 (LoopKit#126)

* Update testflight.md - apple moved keys under integrations (LoopKit#112)

* Update testflight.md - apple moved keys under integrations

* Fix typo

* Update fastlane and macOS (LoopKit#143)

* update Fastlane to 2.221.1

* update runners to macOS 14

* Update submodules

* Ps2/xcode15.4 (LoopKit#145)

* Update to xcode15.4

* update ios version used in circleci builds

* update ios version used in circleci builds

* Update build_loop.yml (LoopKit#146)

* Update submodule for CGMBLEKit

* Update to Loop 3.4 Release

* Fix browser build sync and alive behavior (LoopKit#164)

* Fix browser build sync and alive behavior
- Added logic to extend the alive check for the existence of either `alive-main` or `alive-dev` branches.
  - Resolved an issue where unexpected successes were occurring when failures were expected.
  - Implemented a check to determine the existence of the `alive-main` and `alive-dev` branches and create them if they do not exist.

- Introduced a mechanism to identify the current branch being run (either `main` or `dev`).
  - Based on the current branch, the corresponding alive branch (`alive-main` or `alive-dev`) will be used to check for upstream changes.

- Set a new variable `ABORT_SYNC` to `true` when the current branch is neither `dev` nor `main`.
  - The syncing attempt will proceed based on the `ABORT_SYNC` variable status.

- Ensured proper branch synchronization to prevent build inconsistencies and failures

- Addresses issue LoopKit/Loop#2192

- Updates app store connect link for validation error hints to new Apple URL scheme

* 💚 Security Fix

Co-Authored-By: ebouchut <[email protected]>

---------

Co-authored-by: ebouchut <[email protected]>

* Update for Loop 3.4.1

---------

Co-authored-by: Pete Schwamb <[email protected]>
Co-authored-by: bjornoleh <[email protected]>
Co-authored-by: Marion Barker <[email protected]>
Co-authored-by: Cameron Ingham <[email protected]>
Co-authored-by: Noah Brauner <[email protected]>
Co-authored-by: Deniz Cengiz <[email protected]>
Co-authored-by: Billy Booth <[email protected]>
Co-authored-by: Marion Barker <[email protected]>
Co-authored-by: ebouchut <[email protected]>
gabroo added a commit to gabroo/Loop that referenced this pull request Dec 23, 2024
* Bring in MinimedKit project fix

* Add debug log to TidepoolKit

* TidepoolKit and TidepoolService updates

* Fix double inclusion of ru, and add hi locale

* Update LoopKit submodule

* Remove TidepoolKitUI references

* Ensure food entries have name set

* Tidepool carb upload fix refinement

* Add initialization error logging to TidepoolService

* TidepoolService updates

* Omnipod ref codes fixes

* Bring in TidepoolService and NightscoutService changes

* Fix tests

* Update circleci job name

* change default job name in circleci

* Add version

* Bring in RemoteCommands PRs

* Ensure each submodule branch is at its HEAD before branching

* Bring in latest translations

* Readlink fix

* Fastfile: Add time sensitive notifications to identifier setup (LoopKit#50)

* Fastfile capabilities: add Time Sensitive Notifications to Loop target

Spaceship::ConnectAPI::BundleIdCapability::Type::USERNOTIFICATIONS_TIMESENSITIVE

* Remove instructions for manually adding Time Sensitive Notifications

* G7SensorKit changes

* Meal detection fixes for mmol/L

* Reorg ps2 frameworks (LoopKit#53)

* Update gitmodules to point to LoopKit repos instead of ps2 repos

* Moving submodules

* Add renamed projects

* Nightscout remote cgm rename (LoopKit#54)

* Update gitmodules

* Update NightscoutRemoteCGM submodule references, and project references

* Update submodule rev ro NightscoutRemoteCGM

* Always upload artifacts

* Changes from Tidepool (LoopKit#55)

* Changes from Tidepool

* Update to dev

* Add merges for NightscoutRemoteCGM and G7SensorKit

* Fix tests

* Use MKRingProgressView from swift package

* Update TidepoolKit

* Add Minizip project back in

* Update TidepoolKit

* Update to ZipFoundation for providing zip file creation abilities (LoopKit#56)

* Update to ZipFoundation for providing zip file creation abilities

* Update Loop

* Update to dev

* Warnings cleanup

* Tidepool sync (LoopKit#58)

* Changes from Tidepool

* Update to dev

* Add merges for NightscoutRemoteCGM and G7SensorKit

* Fix tests

* Tidepool Merge

* Fix merge issues

* Update packages

* Add branch name to build name (LoopKit#52)

* G7 sensor reading age fix

* Another G7 date issue fixed

* Status wiget glucose age calc fix

* Bring in latest submodule changes

* Use current Xcode

* Bump xcode version for github workflows

* Update github actions to use macos 13, with latest Xcode

* Bring in Loop and LoopKit changes

* G7 HKDevice update

* Bring in LoopKit crash fix

* Algorithm experiments (LoopKit#62)

* Turn on algorithm experiments

* Loop updates

* IRC added as experiment

* Update Loop submodule

* Bring in analytics changes

* Bring in IRC fix

* Analytics fix

* Adding Libre Integration (LoopKit#51)

* Libre testing branch

* Update submodule

* Update libre branch to latest dev

* Fixes

* Add NFC entitlement

* Update LibreTransmitter to main branch

* Update submodules to latest dev

* update submodule

* Add duration to suspend event

* Update Nightscout service and LoopKit

* Submodule updates

* Add NFC_TAG_READING to fastlane bundle id configuration for Loop

* Update ZipFoundation revision

* Critical log export fix

* Tidepool merge (LoopKit#65)

* Removing TidepoolKit

* Removing TidepoolKit

* Update submodules

* Add scheduled sync and build, and allow for customization of Loop with GitHub Actions / Fastlane builds (LoopKit#43)

* Scheduled sync and build, with option to customize Loop

Changed template for scheduled runs to every month

Added env variables for 
- upstream and target repo/branches
- sync upstream 'true'/'false'
- customize app 'true'/'false'

Added sync action (aormsby/Fork-Sync-With-Upstream-action) to the (sync and) build job

Added gautamkrishnar/keepalive-workflow to avoid expiration of scheduled workflows due to repository inactivity (60 days max). Adds an empty commit to fork if no activity during the last 27 days.

Added Customize Loop action, which 
- applies any patches located in the LoopWorkspace/patches/ directory (@billybooth)
- downloads (wget) and applies submodule patches specified in build_loop.yml

Added (commented-out) CustomTypeOne/LoopPatches as templates for Loop and LoopKit submodule patches.

* Add ./patches/save_patches_here.md

* build_loop.yml: update patch templates for submodules

* build_loop.yml: comment out patch template for submodule Loop

* build_loop.yml: patch template app name = CustomLoop

* Update build_loop.yml: fix typo

* Update save_patches_here.md: fix typo

* build_loop.yml: delete test_mode

* build_loop.yml: remove env CUSTOMIZE_APP

* Update build_loop.yml: remove remaining env CUSTOMIZE_APP refs

* build_loop.yml: remove '--exclude=' from 'git apply'

* Create update.yml

- runs on a frequent schedule
- checks out LoopWorkspace `main`
- compares and syncs with LoopKit/LoopWorkspace (unless owner = LoopKit)
- keepalive action adds empty commits to LoopKit/LoopWorkspace `main` after `time_elapsed` days to to avoid inactivation of scheduled workflows, when these updates are passed on to forks (only if owner = LoopKit)
- launches build_loop.yml workflow on forks to sync and build if new commits are found (unless owner = LoopKit)

* Remove keepalive action from build_loop.yml

- keepalive action moved to update.yml

* Adapt build_loop.yml and update.yml to be run in an "actions" branch

to be set as default, and used to trigger scheduled builds of the main branch. 

Empty commits are added to an "actions" branch only (must be created by the user and set as default) to keep this branch "alive" and allow scheduled workflows to run uninterrupted (max 60 days of inactivity). 

The empty commits will not be included in the resulting TestFlight builds of main.

Removed conditionals regarding LoopKit repository.

* build_loop.yml: Add job names for `secrets` and `upstream_sync_and_build`

* update.yml: shorter job name for `check_latest_from_upstream`:

Check upstream

* build_loop.yml: use curl instead of wget for downloading patches

* Changes to build_loop.yml and update.yml:

build_loop.yml:
-Remove sync action from build_loop.yml
-build on schedule on the 1th every month for a predictable build schedule well within the 90 day TestFlight limit. The time of day should be chosen as a time where ongoing changes are unlikely during releases (nighttime).
-rename env TARGET_BRANCH to BUILD_BRANCH
- use current branch as BUILD_BRANCH for easy switching to building main or dev (manually insert alternative branch names as needed)

update.yml:
- check for updates every day
- use current branch name for UPSTREAM_BRANCH and TARGET_BRANCH, to easily switch between dev and main by changing default branch, without any code changes.
- do not run the upstream sync action on the upstream LoopKit repository
- time_elapsed: 50 days for keepalive action

* Add branch name to run-names 

- with round brackets around branch name for readability:
(${{ github.ref_name }})

* Remove mention of setting TARGET_BRANCH as default, since its not fixed

* Move update and keep alive features to build_loop.yml

- Checks for updates nightly
- Ensures repository activity
- Launches Build job if new commits are found, or if run manually
- Workflow file cleanup

* Delete update.yml

* testflight.md: update GH_PAT instructions

 * Change the Expiration selection to `No expiration`.
 * Select the `repo` and `workflow` permission scopes.

* testflight.md instructions: Create a branch named "alive"

* testflight.md: rephrase section on ‘Create a branch named "alive"’

* Added MixpanelService to Loop (LoopKit#63)

* Added MixpanelService to Loop

* Update module url

* bump mixpanel

* Xcode 15 Beta 3 fixes

* Remove unused project refs, and update MixpanelService signing

* build_loop.yml: Disable upstream sync with optional repository variable (LoopKit#67)

Set an optional "SYNC_UPSTREAM" repository variable to 'false' to disable syncing of fork with the upstream repository

* Update submodules (LoopKit#68)

G7 Logging fix
Libre Demo retain fix
NightscoutRemoteCGM fix deployment target

* build_loop.yml: Separate checkout repo for building (LoopKit#69)

* build_loop.yml: build_loop.yml: Separate checkout repo for building

Checkout for syncing without submodules: recursive

* build_loop.yml: remove "submodules: recursive" from checkout for syncing, fix typo.

* Bring in IRC changes and always use dynamic carbs

* Bring in changes to move charts to LoopKit

* Homescreen Medium Widget, and insulin suspension forecast preview

* Fastlane widget bundleid updates (LoopKit#75)

* Update build_loop.yml

* Update build_loop.yml

* Update Fastfile for widget extension bundle id change

* Adding top-to-bottom algorithm test

* Submodule updates

* Fix for crash when running forecast previews

* Tidepool Sync (LoopKit#80)

* Sync script updates (LoopKit#81)

* Tidepool Sync

* Make sure diffs exist, merge in LoopKit updates

* Bring in LoopDataManager race condition fix

* Update translation repo list

* Update translations from Lokalise (LoopKit#82)

* Update translations from Lokalise

* Bring in translations for more repos

* Bring in translations for more repos

* Scheduled build improvements (LoopKit#71)

* Add conditional scheduled build and sync

* Update testflight.md with instructions for scheduling setup

* Fix typo

* Remove GITHUB_TOKEN; use GH_PAT instead

* Update testflight.md with instructions how to add workflow scope

* Fixed conditions for scheduled build

* Fix upstream repo owner

* Refactor build to use workflow permissions and auto-create alive branch

* Change GITHUB_TOKEN to GH_PAT

* Change token to GITHUB_TOKEN where appropriate; Make env variable names more descriptive

* Fix broken alive branch auto-creation

* Update testflight.md with opt-out and new config info

* Update cron for sync and schedule, update build condition

* Fix typo…

* Update testflight.md with suggestions and re-organized contents

* Fix typo from PR74

* Browser Build "Validate Secrets" Improvements (LoopKit#77)

* Added improved validation and more descriptive error messages

* Add validations from suggestions and test feedback

* Modify validate_secrets to run in readonly mode

* Streamline naming 1/3

* Streamline naming 2/3

* Streamline naming 3/3, add back validation preceding build

* Fix LoopWidgetExtension bundle identifier

* Add fastlane patterns back after accidentally removing them

* Fix Match-Secrets auto-creation and if-condition

* validate_secrets.yml: Set pipefail option so that fastlane exit codes are handled correctly

* workflows: Include branch in (run) names and use consistent capitalization across reusable job names

* This commit is purely aesthetic and aims to make the display names of Jobs consistent across workflows. Likewise, makes spacing and validation error messages consistent.

* validate_secrets.yml: Make annotations more "actionable".

* validate_secrets.yml: Improve error annotations around GH_PAT permissions

* Trivial changes to FASTLANE / ASC error annotations (mention 'Keys' tab)

---------

Co-authored-by: Billy Booth <[email protected]>

* Bump submodule refs

* More carb entry fixes

* Omnipod debug logging updates

* Fixes for automated builds (LoopKit#83)

* Fix broken upstream sync; Remove orphaned environment variable

* Fix condition for automated alive branch creation

* Disable meal detection when calibrations are present, and localization fix

* Bring in fixes for negative duration dose prevention

* Bring in functional algo support

* Bring in changes for app expiration warning for testflight builds

* Tidepool sync

* Fix cron schedule for automated sync and build (LoopKit#87)

* Fix cron schedule for sync and build

* Update cron tab descriptions in testflight.md

* Fix typo in comment

* Adding missing hindi translations for app intents

* Update build destinations

* GH Actions: Improve secrets validation (LoopKit#86)

* validate_secrets.yml: Pass a "Could not install WWDR certificate" error through validation

* validate_secrets.yml: Improve annotation when a public Match-Secrets repo exists

* validate_secrets.yml: Rewrite Match-Secrets validation to be explicit about the Match-Secrets repository that will be used

When the GH account that the GH_PAT token was created under does not match the repository_owner of the LoopWorkspace repository, the validation routine used a different Match-Secrets repository than fastlane.

* validate_secrets.yml: Rewrite GH_PAT validation to capture scopes and distinguish between classic and fine-grained access tokens

* validate_secrets.yml: Fix syntax error in Match-Secrets validation job

* validate_secrets.yml: Depend less on patterns / read scopes from any token that provides them

* Provide HAS_WORKFLOW_PERMISSION as an output

* validate_secrets.yml: Annotate failures from unaccepted Apple PLAs

* validate_secrets.yml: Fix typo and improve annotation when GH_PAT is invalid

* validate_secrets.yml: Improve annotation when authorization fails and token format is unknown

* validate_secrets.yml: Minor wording tweak

* Update Fastlane to 2.215.0 (LoopKit#88)

* Update Gemfile.lock for Fastlane to 2.215.0

Among other improvements, this should fix the WWDR issue.

* build_loop.yml: Install bundle, bundle exec

- bundle install
- bundle exec fastlane build_loop
- bundle exec fastlane release

* Update Gemfile.lock

Commands used to install bundler and update dependencies:

sudo gem pristine ffi
sudo gem install bundler
sudo bundle install
sudo bundle update fastlane

* Don't install bundler, which comes with Ruby 2.7+

* Install dependencies and use bundler to exec fastlane across workflows

---------

Co-authored-by: Billy Booth <[email protected]>

* Bring in CGM Event Store

* Add Mixpanel service to sync

* Bring in Tidepool sync

* Bump Loop submodule rev

* Service state restoration fix

* Upload pod changes to Nightscout as Site Change treatments, for the cannula age (CAGE) pill

* MDT Set change upload

* Bug fix for mdt set change detection, and upload pump alarms to NS

* Add widget fixes

* Update circleci build to xcode 15 (LoopKit#89)

* Update circleci build to xcode 15

* Update workflow to build with Xcode 15

* Bump device

* Fix iphone version

* Run tests on iOS 16.4 until iOS 17 simulators are working

* Include pending insulin in dosing decision

* Update build settings to avoid macos build during translation import

* Bump RileyLinkKit rev

* heartbeat setup fix, and OmniKit translations

* Add slide button cannula insertion

* Disable autolock during pod pairing (Dash)

* Sync the GitHub runner clock with the Windows time server (LoopKit#98)

Adding a step to workflow jobs that interface Apple servers, as a workaround for build issues caused by runner clocks being out of sync. See https://github.com/actions/runner issue number 2996 for details.

name: Sync clock
run: sudo sntp -sS time.windows.com
Added to the following workflows / jobs:

validate_secrets.yml / validate-fastlane-secrets
add_identifiers.yml / identifiers
build_loop.yml / build
create_certs.yml / certificates

* Update submodules

* update to rev of SlideButton package that handles rtl languages (LoopKit#103)

* Bump submodule revs

* Bring in test updates for iOS 17

* include flag for DEBUG_FEATURES_ENABLED by default (LoopKit#111)

* Update submodules for guardrails crash, simulator settings access, and pod pairing UI resumption

* Bring in OmniBLE updates

* Bring in latest submodule revs

* Update browser build action dependencies to meet GH node version requirements (LoopKit#120)

* Bump submodule refs

* Change GITHUB_TOKEN to user-created GH_PAT (LoopKit#125)

Fixes permission issues where GH api responds with:

```swift
gh: Resource not accessible by integration (HTTP 403)
{"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/git/refs#create-a-reference"}
Error: Process completed with exit code 1.
```

because the default, auto-created GITHUB_TOKEN cannot be given appropriate content write permissions to create branches in the owner's repository

* Update Gemfile.lock to bump Fastlane to 2.220.0 (LoopKit#126)

* Update testflight.md - apple moved keys under integrations (LoopKit#112)

* Update testflight.md - apple moved keys under integrations

* Fix typo

* Update fastlane and macOS (LoopKit#143)

* update Fastlane to 2.221.1

* update runners to macOS 14

* Update submodules

* Ps2/xcode15.4 (LoopKit#145)

* Update to xcode15.4

* update ios version used in circleci builds

* update ios version used in circleci builds

* Update build_loop.yml (LoopKit#146)

* Update submodule for CGMBLEKit

* Update to Loop 3.4 Release

* Fix browser build sync and alive behavior (LoopKit#164)

* Fix browser build sync and alive behavior
- Added logic to extend the alive check for the existence of either `alive-main` or `alive-dev` branches.
  - Resolved an issue where unexpected successes were occurring when failures were expected.
  - Implemented a check to determine the existence of the `alive-main` and `alive-dev` branches and create them if they do not exist.

- Introduced a mechanism to identify the current branch being run (either `main` or `dev`).
  - Based on the current branch, the corresponding alive branch (`alive-main` or `alive-dev`) will be used to check for upstream changes.

- Set a new variable `ABORT_SYNC` to `true` when the current branch is neither `dev` nor `main`.
  - The syncing attempt will proceed based on the `ABORT_SYNC` variable status.

- Ensured proper branch synchronization to prevent build inconsistencies and failures

- Addresses issue LoopKit/Loop#2192

- Updates app store connect link for validation error hints to new Apple URL scheme

* 💚 Security Fix

Co-Authored-By: ebouchut <[email protected]>

---------

Co-authored-by: ebouchut <[email protected]>

* Update for Loop 3.4.1

* Xcode 16 updates. Loop 3.4.2

* Update Gemfile.lock for Fastlane 2.223.1 (LoopKit#208)

* Update submodules for Loop 3.4.3 (LoopKit#211)

* Update submodules

* LoopKit: Improve selection choice visibility

* LoopKit: fix locale for CarbEntry decimal separator

* Loop: update version number to 3.4.3

* Loop 3.4.4

* Fix submodule refs for v3.4.4

* Restore main submodule ref for 3.4.4

---------

Co-authored-by: Pete Schwamb <[email protected]>
Co-authored-by: bjornoleh <[email protected]>
Co-authored-by: Marion Barker <[email protected]>
Co-authored-by: Cameron Ingham <[email protected]>
Co-authored-by: Noah Brauner <[email protected]>
Co-authored-by: Deniz Cengiz <[email protected]>
Co-authored-by: Billy Booth <[email protected]>
Co-authored-by: Marion Barker <[email protected]>
Co-authored-by: ebouchut <[email protected]>
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

Successfully merging this pull request may close these issues.

5 participants