כיצד להוסיף שאילתות של Data Explorer מתוסף?

I’ve got a suspicion there is a missing API here.

Data Explorer has become more and more useful as part of a Plugin workflow, but:

How do we reliably but tolerantly add Data Explorer queries from a third party plugin so we can fail gracefully without jeopardising the build but also retry each time in case Data Explorer is eventually installed?

Options I’ve explored:

  1. Poll Plugin: this cheats - the queries are added by the Data Explorer plugin itself
  2. Plugin fixtures - this appears to be problematic because the Data Explorer artifacts don’t seem to be guaranteed to be available during plugin initialisation - perhaps because the Data Explorer plugin is itself a third party plugin and not guaranteed to have been loaded? I guess I could try to use SQL via Ruby code to identify if the table exists?
  3. Migrations - I’ve written migrations but they need to harmlessly fail BUT NOT COMPLETE if Data Explorer plugin is not installed and there is no query table - the migrations should always run on rebuild until the Data Explorer plugin is installed and the table available so the queries can be added - that way from an admin point of view the solution is flexible and not depend on installation order. A failing migration should not jeopardise the build - is there a way to fail/put off a migration without stopping the build?
  4. Using a periodic scheduled job to check presence of both the data explorer plugin/query table and the required queies.
  5. Asking the admin to manually add them … yuk.

I guess I may try the SQL version of 2 next or maybe I’m missing something?

לייק 1

אני אעיף מבט בקוד שלי שתלוי בתוסף המנויים.

למה אתה צריך את סייר הנתונים? האם המטרה היא ליצור שאילתות שמשתמש קצה ישתמש בהן?

Yes, exactly that. Data Explorer is getting to a point where you can use it for administrative tasks for those with elevated roles in a process.

לייק 1

אתה יכול ליצור ג’וב שרץ כדי לבדוק שהם מותקנים. הוא לא יתחיל עד שהכל פועל.

אבל כדי לוודא שדברים לא שבורים אתה יכול לבדוק שקריאת סייר נתונים כלשהי זמינה. אני חושב שזה מה שאני עושה עבור מינויים, אולי. (עוד מוקדם ולא פתחתי את המחשב הנייד שלי.)

הם הוסיפו קוד בשבוע שעבר שבודק אם תוסף הצ’אט נטען.

אני חושב שהבעיה שלך היא תנאי מירוץ, אם כי.

לייק 1

כן, אפשרות זו חסרה מרשימת האפשרויות הזמינות, אוסיף אותה.

אבל האם הפעלת משימה (שתמשיך לפעול מעת לעת ולבדוק) לא נראית קצת בזבזנית?

הצעה טובה בכל זאת (ושקלתי את זה אבל זה הרגיש קצת …)

אולי פשוט תשימו אותו בתור לריצה פעם אחת בעת ההפעלה? וזה ירוץ עד שהבדיקה של הפלאגין תצליח או שתמות אחרי כמה דקות?

לייק 1

אני אוהב את הרעיון של הוספה לתור באתחול. זה עשוי להתגבר על בעיית הטעינה. אני מעדיף את זה על האפשרות של פעם ב-24 שעות. אולי אנסה את זה! תודה!

btw, the answer to this would also be generally useful for a broader set of problems.

אני חושב שפשוט לשים את הבדיקה שלך במקום כלשהו שממנו היא תינצל אם היא תיכשל זה כל מה שאתה צריך. אבל אתה לא יכול פשוט לבדוק כדי לראות אם משהו כמו DataExplorer.משהו קיים?

אני לא יודע מספיק על שימוש בהעברות כדי לשקול להשתמש בהן עבור מקרה השימוש שלך. אתה יכול גם שיהיה לך נקודת קצה ש, למשל, פאנל האדמין קרא לה, והיא תבדוק שיש לך את השאילתות שלך מותקנות.

עכשיו כשאני חושב על זה, אני חושש שהבעיה היחידה שבעצם פתרתי היא הוספת הפלאגין האחר כדי שבדיקות יוכלו לעבוד.