You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "szaszm (via GitHub)" <gi...@apache.org> on 2023/06/30 05:28:38 UTC

[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1591: MINIFICPP-2130 Custom cache eviction strategy for GitHub Actions

szaszm commented on code in PR #1591:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1591#discussion_r1236873733


##########
.github/workflows/ci.yml:
##########
@@ -142,6 +154,12 @@ jobs:
               -DENABLE_AZURE=OFF -DENABLE_SPLUNK=OFF -DENABLE_GCP=OFF -DENABLE_PROCFS=OFF -DENABLE_BUSTACHE=ON -DENABLE_PCAP=ON -DENABLE_JNI=ON -DENABLE_SFTP=ON  \
               -DENABLE_LUA_SCRIPTING=OFF -DENABLE_PYTHON_SCRIPTING=OFF -DENABLE_MQTT=OFF -DENABLE_ELASTICSEARCH=OFF -DENABLE_KUBERNETES=OFF -DENABLE_OPC=OFF ..
           make -j$(nproc) VERBOSE=1
+      - name: cache save
+        uses: actions/cache/save@v3
+        if: always()
+        with:
+          path: ~/.ccache
+          key: ubuntu-20.04-ccache-${{github.ref}}-${{github.sha}}

Review Comment:
   How did this work before adding the explicit path declaration? Why is the change necessary?



##########
github_scripts/github_actions_cache_cleanup_tests.py:
##########
@@ -0,0 +1,80 @@
+#!/bin/python3
+
+import unittest
+from unittest.mock import MagicMock
+from github_actions_cache_cleanup import GithubActionsCacheCleaner
+
+
+class TestGithubActionsCacheCleaner(unittest.TestCase):
+    def create_mock_github_request_sender(self):
+        mock = MagicMock()
+        mock.list_open_pull_requests = MagicMock()
+        open_pull_requests = [
+            {
+                "number": "227",
+                "title": "MINIFICPP-13712 TEST1",
+            },
+            {
+                "number": "228",
+                "title": "MINIFICPP-9999 TEST2",
+            },
+            {
+                "number": "229",
+                "title": "MINIFICPP-123 TEST3",
+            }
+        ]
+        mock.list_open_pull_requests.return_value = open_pull_requests
+        caches = {
+            "actions_caches": [
+                {
+                    "id": "999",
+                    "key": "macos-xcode-ccache-refs/pull/226/merge-6c8d283f5bc894af8dfc295e5976a5f154753123",
+                },
+                {
+                    "id": "11111",
+                    "key": "ubuntu-20.04-ccache-refs/pull/227/merge-9d6d283f5bc894af8dfc295e5976a5f1b46649c4",
+                },
+                {
+                    "id": "11112",
+                    "key": "ubuntu-20.04-ccache-refs/pull/227/merge-1d6d283f5bc894af8dfc295e5976a5f154753487",
+                },
+                {
+                    "id": "12345",
+                    "key": "macos-xcode-ccache-refs/pull/227/merge-2d6d283f5bc894af8dfc295e5976a5f154753536",
+                },
+                {
+                    "id": "22221",
+                    "key": "macos-xcode-ccache-refs/heads/MINIFICPP-9999-9d5e183f5bc894af8dfc295e5976a5f1b4664456",
+                },
+                {
+                    "id": "22222",
+                    "key": "macos-xcode-ccache-refs/heads/MINIFICPP-9999-8f4d283f5bc894af8dfc295e5976a5f1b4664123",
+                },
+                {
+                    "id": "44444",
+                    "key": "ubuntu-20.04-all-clang-ccache-refs/heads/main-1d4d283f5bc894af8dfc295e5976a5f1b4664456",
+                },
+                {
+                    "id": "55555",
+                    "key": "ubuntu-20.04-all-clang-ccache-refs/heads/main-2f4d283f5bc894af8dfc295e5976a5f1b4664567",
+                }

Review Comment:
   Out of these two, how do we determine which one is newer? We should keep the newest cache.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org