概要
こんにちは、 WcaleNieWolny - Capgoのリードソフトウェアエンジニアです。
過去8ヶ月間、組織システムの開発を進めてきました。2023年4月14日現在、システムは完成しました🎉 🎊 ようやく8ヶ月の長い間、すべての__CAPGO_KEEP_0__の部分が組織メンバーにアクセス可能になりました。これには含まれます:アプリ
Finally, after 8 months, every single part of Capgo is accessible to org members. This includes:
- 請求
- 完全な__CAPGO_KEEP_0__サポート
- Capgo
- full CLI support
- とても多くの機能があります!
ここまで来るには、システムの3つの大きな改訂が必要でした。
組織v1
最初は、プロジェクトに参加してから2週間でこの作業を始めました。時点では、コードベースや実装方法についての理解はほとんどありませんでした。
その結果、最もハック的な解決策を実装し、しかもアプリ、チャネル、バージョンにしかアクセスできませんでした。招待されたユーザーは、統計情報にアクセスすることもできませんでした。
And then I waited for Martin to review this. I waited and waited, but nothing really happened. 3 months later, I decided to come back to this and fix all the merge conflicts. I also decided to test, which turned out to be a great idea. To no surprise, the hacky solution completely failed. At that moment, I decided to fix all bugs and write an extensive E2E test. I had to work with very broken code and a lot of bad decisions made by the past me, but after 2 hard weeks, I finally got it to function.
That does not, however, mean that it was perfect. The owner of the organization still had a lot more access than even the highest invited user. User experience also was quite lacking. The invited user could not even see the application statistics, manage billing, and the CLI was limited to upload only.
過去の私が残した多くの不正解決策や、非常に壊れた__CAPGO_KEEP_0__と戦いながら、2週間の辛勉強の後、ようやく機能するようになりました。
しかし、それでも完璧ではありませんでした。組織のオーナーは、招待されたユーザーよりも多くのアクセス権を持っており、ユーザー体験も大幅に不足していました。招待されたユーザーは、統計情報を表示することさえできませんでした。請求管理や__CAPGO_KEEP_0__のアップロード機能も利用できませんでした。
The organization system was working rather well despite all of the challenges. Users were using it, and it really pushed the entire project forward. However, I still had to:
- fix the mess made in row level security
- add support for the entire CLI
- ensure that admin users have the same access as the owner
row level security add support for the entire __CAPGO_KEEP_0__ with Martin, we decided that the best way to move forward was to rewrite the entire security rules and to move all the resource ownership to organizations and not users. This would allow for easier integration with the new organization system, and it would also remove a lot of legacy code.
Writing the new RLS code was very tedious, but after a week and a half, the entire migration was ready.
a lot of discussions
with Martin, we decided that the best way to move forward was to rewrite the entire security rules and to move all the resource ownership to organizations and not users. This would allow for easier integration with the new organization system, and it would also remove a lot of legacy __CAPGO_KEEP_0__.
Writing the new RLS __CAPGO_KEEP_0__ was very tedious, but after a week and a half, the entire migration was ready. This time, however, we decided against writing the E2E test, which meant that we had to test it manually. After 3 very extensive calls together, Martin and I finally decided to push to production and hope it would go well 🤖"It didn’t… It turns out that I broke user registration, and new users could not create an account 😂"After a quick panic call, I quickly pushed some changes into prod and went to bed. Unfortunately, my changes only created more problems 😜"
起床後、ユーザーが多くの空の組織を持っていることを発見した。1つの組織だけが許可されるはずなので、これは起こるはずがない。重複した空の組織をすべて削除するのに時間がかかったが、それ以外の変更は比較的順調だった。
組織 v3
それでも十分ではなかった。課金に関する大きなコンポーネントが欠けていた。
現在、オーナーだけが課金を管理できていた。ユーザーが組織に課金を購入したと考えていたが、実際は自分自身に課金を購入したことになっていた問題が生じていた。
この問題は手動で直したが、この問題は受け入れられないと判断した。
マイグレーションは比較的 smooth であった。1週間の作業がかかったが、V1とV2と比べるとそれほど難しくなかった。
組織 v4 - 未来
It was not easy but I learned a lot and capgo has received a very nice and important feature I still have to deprecate the legacy functions, improve the webapp user experience, monitor for bugs, but there should not be any major changes to this system.
これは簡単ではなかったが、__CAPGO_KEEP_0__ に重要で素晴らしい機能が追加された。
まだ、古い機能を非推奨にし、Webアプリのユーザー体験を向上させ、バグを監視する必要があるが、このシステムに大きな変更は行わないだろう。
読んでくれてありがとう 🚀 A から始めて新しい組織システムを続けよう。 ダッシュボードとAPIの運用計画を立てるには、 APIの概要 APIの概要の実装詳細については 導入 導入の実装詳細については APIのキー APIのキーについての実装詳細 デバイス デバイスの実装詳細 バンドル バンドルについての実装詳細