From 14a86066f1610c41ebce613f68c695f1524d54b3 Mon Sep 17 00:00:00 2001 From: adam-op Date: Fri, 4 Nov 2022 13:08:32 +0100 Subject: [PATCH 1/3] [#44763] Add information about Attachments to Enterprise Cloud Backup [#44763] Add information about Attachments to Enterprise Cloud Backup https://community.openproject.org/work_packages/44763 --- .../enterprise-cloud-guide/backups/README.md | 16 +++++++++++++--- .../backups/backup-enterprise-cloud.png | Bin 0 -> 10609 bytes 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 docs/enterprise-guide/enterprise-cloud-guide/backups/backup-enterprise-cloud.png diff --git a/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md b/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md index 1240f193ce..92a16ab8e1 100644 --- a/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md +++ b/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md @@ -8,12 +8,22 @@ keywords: backups # Backups -## Enterprise cloud +## Data retention policy -Your Enterprise cloud data is backed up continuously and retained for 30 days. Within those 30 days we can restore your data to any point in time with a precision of 5 minutes, in case you need us to. +Your Enterprise cloud data is backed up continuously and retained for 30 days. Within those 30 days we can restore your data to any point in time with a precision of 5 minutes, in case you need us to. (currently this is valid only for cloud instances located in the openproject.com cloud environment) *Note: At the moment it is only possible to restore the complete instance into a former state. All future edits after the former state will be not available in the restored instance. In order to offer you the possibility of recreating the restored information to your productive instance, the restored version is temporarily available on a separate URL. You will have all the time you need to clone the lost information from the temporary instance to the production one. This could be done by using e.g. API calls or manual interaction.* +## Resource limitations for attachments + +Currently resource limitations in the Enterprise Cloud allow a Backup to contain attachments only in the case if the file size of all attachments of your instance are less than 1 GB of data. Please contact us at [support@openproject.com](mailto:support@openproject.com) in order to manually request a complete backup containing the SQL dump including all attachments or try to delete unused attachments in order to get below 1 GB of data usage. + +In this case you cannot check the **Include attachments** check-box like on the screen-shot below, it will be grayed out: + +![backup-enterprise-cloud](backup-enterprise-cloud.png) + + + ## Backup via GUI -**Please navigate to the [System admin guide Backup page](../../../system-admin-guide/backup/)** +Please navigate to the [System admin guide Backup page](../../../system-admin-guide/backup/) diff --git a/docs/enterprise-guide/enterprise-cloud-guide/backups/backup-enterprise-cloud.png b/docs/enterprise-guide/enterprise-cloud-guide/backups/backup-enterprise-cloud.png new file mode 100644 index 0000000000000000000000000000000000000000..164a281d42fc7f87deb659ef06c631f05e642dba GIT binary patch literal 10609 zcmc(FXH?To^d=oefmacE0RbB#U8NI>4Wxr~LbcEW0R%#5AtEXwA|kzmQbR8Z(gG@i z1PDEp5I~R`5~L(RLc-#I&+a+9=l@~%?AhH9zu%p9X6`&QckXj$Zk&bL1702x9u^iB zUPFWXmMko68^`IQ6I{pt{>F&0W5F6^`QR=~HTJ^VafZY5j_Dm1mb%1KhmSaq^Ctrg z9D-O__`d)BSbO}-p0cn=a~a;hV;$;3BAkr0UTQzuQjC{-G{B%EJ-ab4fy{zX<(mP>Ls zPyUnKe-wtzF}#-SkbLsOw-rYCfX}k;U|8NtPUa3^FbtciuXFE?s>f3=FOL!c$FX|z z)}ReE`*GsWMYfP*(fR$vB*zfHwjEtXGgcqM<+%CPq))Fd)X&A(&^Yi!f=o|fac$!m`sQ{3f&JTXhB-gyRPXLr*Wfv0-uk~ykRt)?)RDVlTA>!Nipc>g#WKpH zeBufZn*k*u7@I)#aLwXZ9<;A_8@lahv|eSZZSIiBQg&aXmLAC36;V>tS8H>{(U$$c zzk5u5mx;6Zw^Z&77;)Ju1H9Dcj?OeQ(#reQYN|%pA)rBcPDb9s8kOew8E7 zJz@<2j{x`G59AVqud)u}0~u?oXH7uqm5 z-1qyh>#Rq&89ys`vOXt`)b6DCY-VM)_%Bz;kY^m^69o~G^UB(^zU;A;Q;yXGBH?y* zwhD~9@(_zwQRl+ULF|}1zMPOoe=pYJ`%S!R)}r8J`vc|G(j5o^Crlg9792?;$dHd* zZHO{+6)H-bql-1^2r#}x)7HK^>1d~o8S%2b=wJLw?wt7;`yjmVake`VcoaftIFxGH z+}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ks?tp9kmeseLxA_1{qV39m z>Q%#!668qG{7y?0yg_yOWsW;?X z(FcY{OSbhCQ?5OeV4BYRjw&~}Xl9ptDPr(1h6TNo1pJK z48S*6(G}@I3_|l?AzPYg<()y!vis)(1{z zycD-jFZ^+`iElAjIgHH4Tx3H&rdy~HM~b)Oq*3wupX7;!zUgU;tR&AjYTfn6ER|ASWs{zHXx&q9|wVX+1?@@hMF&(F=AKg@W{#t^UFN~{YMP2ID zl?S%VbM*&x5W-~@LTs<$qyEUDMD7@JQ=Q z+p0e6nYP64+0d%jAz$(MWh~@so{wZRHQ}wiQ#|;4zftOohyP( zATYY$eO+}|#90@e?~CNXgupsVvXr-gFz*nrt_8TsuYpvUHOUmzSRKKR?@l})(n++m zYV~0rmX3!qWXTy>pOCfOC3-&I?Q&>KgjGUJtGSl$6}IAakVOIjVX*m3^I5 zp}-meJ3)H?cxqmAI9p#HUr*@bX#SOkteS!}f3m=9=?O>=1UNrFJN&%0>pt#__zQ^a z)LLG@8)1ET@d9kG)e5qb3sv`Iu&`V_*tm%k_aWVEB4Jm}ZR(<1!2g`)#mVC}H?+jA z^()tugWY^v^X~&u)dcuQu}Viuk_T)%_!PZ2WMN)`q&e&$RD^=`giaLRi%rRdasw_)*8es%Ce_O3wvkhs6GU)W%dzkzShWB=#pLBMh8{GzoEsytpDpv^8c^fJV^#T Y5(@Y(7_X#vj17ySp4t8CyKXQ33+GB83jhEB literal 0 HcmV?d00001 From 7dbb3ce1b4473a9c5097068589c882d6776c6946 Mon Sep 17 00:00:00 2001 From: adam-op Date: Mon, 7 Nov 2022 10:24:07 +0100 Subject: [PATCH 2/3] rephrasing --- docs/enterprise-guide/enterprise-cloud-guide/backups/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md b/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md index 92a16ab8e1..ba1e149ad8 100644 --- a/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md +++ b/docs/enterprise-guide/enterprise-cloud-guide/backups/README.md @@ -26,4 +26,4 @@ In this case you cannot check the **Include attachments** check-box like on the ## Backup via GUI -Please navigate to the [System admin guide Backup page](../../../system-admin-guide/backup/) +For detailed usage of the Backup via GUI, please navigate to the [System admin guide Backup page](../../../system-admin-guide/backup/) From 790551c4c876ebab5c1d79b4dd63bd13ed9bb474 Mon Sep 17 00:00:00 2001 From: Christophe Bliard Date: Thu, 10 Nov 2022 17:49:10 +0100 Subject: [PATCH 3/3] Allow nil for integer settings with nil default value --- app/models/setting.rb | 16 ++++++++++++++- spec/models/setting_spec.rb | 41 +++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/app/models/setting.rb b/app/models/setting.rb index ab6b64a12d..2b86914328 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -150,8 +150,22 @@ class Setting < ApplicationRecord validates :value, numericality: { only_integer: true, - if: Proc.new { |setting| setting.format == :integer } + if: ->(setting) { setting.non_null_integer_format? } } + validates :value, + numericality: { + only_integer: true, + allow_nil: true, + if: ->(setting) { setting.nullable_integer_format? } + } + + def nullable_integer_format? + format == :integer && definition.default.nil? + end + + def non_null_integer_format? + format == :integer && !definition.default.nil? + end def value self.class.deserialize(name, read_attribute(:value)) diff --git a/spec/models/setting_spec.rb b/spec/models/setting_spec.rb index be95b643ae..3f777e4e44 100644 --- a/spec/models/setting_spec.rb +++ b/spec/models/setting_spec.rb @@ -179,6 +179,47 @@ describe Setting, type: :model do expect { described_class.smtp_openssl_verify_mode = 'none' } .to raise_error NoMethodError end + + context 'for a integer setting with non-nil default value', :settings_reset do + before do + Settings::Definition.add( + 'my_setting', + format: :integer, + default: 42 + ) + end + + it 'does not save it when set to nil' do + expect(described_class.my_setting).to eq(42) + described_class.my_setting = nil + expect(described_class.my_setting).not_to be_nil + expect(described_class.my_setting).to eq(42) + end + end + + context 'for a integer setting with nil default value', :settings_reset do + before do + Settings::Definition.add( + 'my_setting', + format: :integer, + default: nil + ) + end + + it 'saves it when set to nil' do + described_class.my_setting = 42 + expect(described_class.my_setting).to eq(42) + described_class.my_setting = nil + expect(described_class.my_setting).to be_nil + end + + it 'saves it as nil when set to empty string' do + described_class.my_setting = 42 + expect(described_class.my_setting).to eq(42) + described_class.my_setting = '' + expect(described_class.my_setting).to be_nil + end + end end describe '.[setting]_writable?' do